diff options
176 files changed, 10602 insertions, 13083 deletions
@@ -6,7 +6,7 @@ This repo is intended to demonstrate the Sea-of-Nodes compiler IR. The Sea-of-Nodes is the core IR inside of HotSpot's C2 compiler and Google's V8 compiler and Sun/Oracle's Graal compiler. -Since we are show casing the SoN IR, the *language* being implemented is less +Since we are showcasing the SoN IR, the *language* being implemented is less important. We're using a very simple language similar to C or Java, but with far fewer features. Simple is strongly typed, object-oriented, with first-class *functions* not *closures*. Object references are pointers, and null @@ -16,12 +16,12 @@ has a minimal syntax that can be parsed with a recursive descent parser. The Sea-of-Nodes is used for machine code generation in these industrial strength systems - but for this demonstration the backend is both difficult and -less important. This repo targets X86, RISC5 and ARM64 at least with +less important. This repo targets x86-64, RISC-V and ARM64 with ahead-of-time compilation - but with an eye towards JIT compilation. This repo also is not intended to be a complete language in any sense, and so -the backend starts with levering Java: the Evaluator (first appears in Chapter -10a) directly slowly interprets the SoN IR. Code-gen first appears in Chapter +the backend starts with a Java evaluator (first introduced in Chapter +8) that directly interprets the SoN IR. Code generation first appears in Chapter 19. @@ -74,7 +74,7 @@ The Simple language is styled after a subset of C or Java. ## Building across chapters The optional [interactive graph viewer](graph/README.md) is shared in `graph/`. -Chapters 10a, 10b, and 18–25 launch it with `make view` from the chapter directory. +Chapters 1–25, including 10a and 10b, launch it with `make view` from the chapter directory. The [debug printers](print/README.md) are shared in `print/`; Chapter 2 needs only a one-line expression format. A shared `BaseNode` supplies identity and edge diff --git a/chapter01/README.md b/chapter01/README.md index 17e24ea0..ebe2811e 100644 --- a/chapter01/README.md +++ b/chapter01/README.md @@ -1,21 +1,23 @@ # Chapter 1: Introduction +[Introduction](../README.md) | +[Next: Chapter 2](../chapter02/README.md) + # Table of Contents -1. [Implementation Language](#implementation-language) -2. [Assumptions](#assumptions) -3. [Architecture](#architecture) -4. [Data Structures](#data-structures) -5. [Intermediate Representation as a Graph of Nodes](#intermediate-representation-as-a-graph-of-nodes) -6. [Nodes are in a Graph](#nodes-are-in-a-graph) -7. [Types of Nodes](#types-of-nodes) -8. [Unique Node ID](#unique-node-id) -9. [Start Node](#start-node) +1. [Implementation Language](#implementation-language) +2. [Assumptions](#assumptions) +3. [Architecture](#architecture) +4. [Data Structures](#data-structures) +5. [Intermediate Representation as a Graph of Nodes](#intermediate-representation-as-a-graph-of-nodes) +6. [Nodes are in a Graph](#nodes-are-in-a-graph) +7. [Types of Nodes](#types-of-nodes) +8. [Unique Node ID](#unique-node-id) +9. [Start Node](#start-node) 10. [Constant Node](#constant-node) 11. [Return Node](#return-node) 12. [Representation](#representation) - You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter01) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch. @@ -41,7 +43,7 @@ Our implementation language is Java. We chose Java as it is widely available and ## Assumptions We assume that the reader is familiar with traditional linear intermediate representations, and is familiar with terms such as Basic Block, Control Flow Graph, etc. No attempt is made to explain these topics. -If necessary the reader can consult a standard compiler text book. +If necessary the reader can consult a standard compiler textbook. ## Architecture @@ -50,7 +52,7 @@ a number of pessimistic peephole optimizations can be performed while parsing a ## Data Structures -Our data structures are based upon the descriptions provided in following papers: +Our data structures are based upon the descriptions provided in the following papers: * [From Quads to Graphs: An Intermediate Representation's Journey](http://softlib.rice.edu/pub/CRPC-TRs/reports/CRPC-TR93366-S.pdf) * [Combining Analyses, Combining Optimizations](https://dl.acm.org/doi/pdf/10.1145/201059.201061) @@ -73,9 +75,9 @@ Each `Node` represents an "instruction" as it may appear in traditional IRs. ### Nodes are in a Graph The key idea of the Sea of Nodes IR is that each Node is linked to other Nodes by def-use dependencies. -As this is such an important and fundamental aspect of the IR, it is important to understand how we implement this, and depict in graph visuals. +As this is such an important and fundamental aspect of the IR, it is important to understand how we implement this, and depict this in graph visuals. -The base `Node` class maintains a list of Nodes that are inputs to it. An input is an edge from a "def" to a "use". What this means is that if `B` is definition, and `A` uses `B`, +The base `Node` class maintains a list of Nodes that are inputs to it. An input is an edge from a "def" to a "use". What this means is that if `B` is a definition, and `A` uses `B`, then there is a def-use edge from `B` to `A`. Visually we show an arrow from the "use" to the "def". Here is an example: @@ -110,7 +112,7 @@ public abstract class Node { * <p> * Outputs directly match inputs, making a directed graph that can be * walked in either direction. These outputs are typically used for - * efficient optimizations but otherwise have no semantics meaning. + * efficient optimizations but otherwise have no semantic meaning. */ public final ArrayList<Node> _outputs; } @@ -173,7 +175,7 @@ The Return's output is the value from the data node. ### Representation -Here is visualization of the program: +Here is a visualization of the program: ``` return 1; @@ -181,7 +183,7 @@ return 1;  -* Control nodes appear as square boxes with yellow background -* Control edges are in bold red -* The edges from Constants to Start are shown in dotted lines as these are not true control edges +* Control nodes appear as rectangular boxes with pale yellow backgrounds +* Control edges are red and thicker than data edges +* The edges from Constants to Start are shown as dashed gray lines as these are not true control edges * We label each edge with its position in the `_inputs` array, thus `0` means the edge is `_inputs[0]`. diff --git a/chapter01/docs/01-graph.json b/chapter01/docs/01-graph.json new file mode 100644 index 00000000..f489c4fe --- /dev/null +++ b/chapter01/docs/01-graph.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter01/docs/01-graph.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter01/docs/01-graph.svg b/chapter01/docs/01-graph.svg index 7f511966..d8ec5cb7 100644 --- a/chapter01/docs/01-graph.svg +++ b/chapter01/docs/01-graph.svg @@ -1,56 +1,73 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter01 Pages: 1 --> -<svg width="114pt" height="220pt" - viewBox="0.00 0.00 114.00 220.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 216)"> -<title>chapter01</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-216 110,-216 110,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-204 98,-204 98,-8 8,-8"/> -</g> -<!-- Start1 --> -<g id="node1" class="node"> -<title>Start1</title> -<polygon fill="yellow" stroke="black" points="80,-196 26,-196 26,-160 80,-160 80,-196"/> -<text text-anchor="middle" x="53" y="-174.3" font-family="Times,serif" font-size="14.00">Start</text> -</g> -<!-- Con_2 --> -<g id="node2" class="node"> -<title>Con_2</title> -<ellipse fill="none" stroke="black" cx="43" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-102.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Con_2->Start1 --> -<g id="edge1" class="edge"> -<title>Con_2->Start1</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M45.42,-123.95C46.52,-131.65 47.85,-140.97 49.09,-149.64"/> -<polygon fill="black" stroke="black" points="45.65,-150.32 50.53,-159.72 52.58,-149.33 45.65,-150.32"/> -<text text-anchor="middle" x="42.42" y="-126.55" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return3 --> -<g id="node3" class="node"> -<title>Return3</title> -<polygon fill="yellow" stroke="black" points="86,-52 20,-52 20,-16 86,-16 86,-52"/> -<text text-anchor="middle" x="53" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return3->Start1 --> -<g id="edge2" class="edge"> -<title>Return3->Start1</title> -<path fill="none" stroke="red" d="M64.05,-52.39C69.74,-62.38 76.08,-75.42 79,-88 82.62,-103.59 82.62,-108.41 79,-124 76.9,-133.04 73.03,-142.32 68.91,-150.53"/> -<polygon fill="red" stroke="red" points="65.69,-149.14 64.05,-159.61 71.86,-152.45 65.69,-149.14"/> -<text text-anchor="middle" x="61.05" y="-54.99" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return3->Con_2 --> -<g id="edge3" class="edge"> -<title>Return3->Con_2</title> -<path fill="none" stroke="black" d="M50.53,-52.3C49.43,-60.02 48.1,-69.29 46.87,-77.89"/> -<polygon fill="black" stroke="black" points="43.39,-77.5 45.44,-87.9 50.32,-78.49 43.39,-77.5"/> -<text text-anchor="middle" x="47.53" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="320" height="208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC</title></path><path class="edge CTRL" id="e3i0" d="M84,80 L84,128" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #1 · CTRL</title></path><path class="edge DATA" id="e3i1" d="M236,80 L236,90 L124,90 L124,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#3[1] → #2 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n2" data-id="2" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 #1 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n3" data-id="3" transform="translate(44,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 Return +Type not computed + +[0] → #1 CTRL +[1] → #2 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter01/docs/01-use-def.json b/chapter01/docs/01-use-def.json new file mode 100644 index 00000000..5e6f2df6 --- /dev/null +++ b/chapter01/docs/01-use-def.json @@ -0,0 +1,13 @@ +{ + "ver": 1, + "comp": "chapter01/docs/01-use-def.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "A", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": null}, + {"id": 2, "label": "B", "type": null, "kind": "DATA", "edges": [], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter01/docs/01-use-def.svg b/chapter01/docs/01-use-def.svg index 644ab5a2..b0ecd3da 100644 --- a/chapter01/docs/01-use-def.svg +++ b/chapter01/docs/01-use-def.svg @@ -1,35 +1,69 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter01 Pages: 1 --> -<svg width="94pt" height="148pt" - viewBox="0.00 0.00 94.00 148.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 144)"> -<title>chapter01</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-144 90,-144 90,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-132 78,-132 78,-8 8,-8"/> -</g> -<!-- A --> -<g id="node1" class="node"> -<title>A</title> -<ellipse fill="none" stroke="black" cx="43" cy="-34" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-30.3" font-family="Times,serif" font-size="14.00">A</text> -</g> -<!-- B --> -<g id="node2" class="node"> -<title>B</title> -<ellipse fill="none" stroke="black" cx="43" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-102.3" font-family="Times,serif" font-size="14.00">B</text> -</g> -<!-- A->B --> -<g id="edge1" class="edge"> -<title>A->B</title> -<path fill="none" stroke="black" d="M43,-52.3C43,-60.02 43,-69.29 43,-77.89"/> -<polygon fill="black" stroke="black" points="39.5,-77.9 43,-87.9 46.5,-77.9 39.5,-77.9"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="168" height="202" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 168 202" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge DATA" id="e1i0" d="M84,74 L84,122" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#1[0] → #2 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,128)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>A</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 A +Type not computed + +[0] → #2 DATA</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>B</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 B +Type not computed + +</title></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter01/docs/Makefile b/chapter01/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter01/docs/Makefile +++ b/chapter01/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter02/README.md b/chapter02/README.md index eda25269..9b6d3651 100644 --- a/chapter02/README.md +++ b/chapter02/README.md @@ -1,5 +1,8 @@ # Chapter 2: Arithmetic +[Previous: Chapter 1](../chapter01/README.md) | +[Next: Chapter 3](../chapter03/README.md) + # Table of Contents @@ -24,7 +27,7 @@ Here is the [complete language grammar](docs/02-grammar.md) for this chapter. ## Extensions to Intermediate Representation -In [Chapter 1](../chapter01/README.md) we introduced following nodes. +In [Chapter 1](../chapter01/README.md) we introduced the following nodes. | Node Name | Type | Description | Inputs | Value | |-----------|---------|------------------------------------|------------------------------------------------------------------|-------------------------------------------------------| @@ -32,7 +35,7 @@ In [Chapter 1](../chapter01/README.md) we introduced following nodes. | Return | Control | End of function | Predecessor control node, Data node value | Return value of the function | | Constant | Data | Constants such as integer literals | None, however Start node is set as input to enable graph walking | Value of the constant | -We extend the set of nodes by adding following additional node types. +We extend the set of nodes by adding the following additional node types. | Node Name | Type | Description | Inputs | Value | |-----------|------|-------------------------------|------------------------------------------------------------|-----------------------------| @@ -51,7 +54,7 @@ equality. This is by far the most common case. In [Chapter In both cases the choice of value-vs-reference equality is intentional: it is *never* correct to "just pick one or the other kind of equality". When in doubt check the context: only *Global Value Numbering* uses value equality; -everywhere we mean reference equality. +everywhere else we mean reference equality. ## Peephole Optimizations @@ -77,7 +80,7 @@ may *kill* the unused constants `1` and `2`. ## Constant Folding and Constant Propagation -In this chapter and next we focus on a particular peephole optimization: +In this chapter and the next we focus on a particular peephole optimization: constant folding and constant propagation. Since we do not have non-constant values until [Chapter 4](../chapter04/README.md), the main feature we demonstrate now is constant folding. However, we introduce some additional ideas into the compiler at this stage, to @@ -91,14 +94,14 @@ optimizations such as: constant. This idea can be extended in a number of ways and is called [Partial Evaluation](https://en.wikipedia.org/wiki/Partial_evaluation). * The compiler may be able to identify regions of code that are dead and no - longer needed, such as when a conditional branch always take one of the + longer needed, such as when a conditional branch always takes one of the branches ([Chapter 6](../chapter06/README.md)). * Pointers may be known to be not-null, and a null check can be skipped ([Chapter 10a](../chapter10a/README.md)). * Array indices may be known to be in-range, and a range check can be skipped. * Many additional optimizations are possible when the compiler learns more about the possible set of Node values. -In order to achieve above, we need a way to talk about what kinds of values a Node can take +In order to achieve this, we need a way to talk about what kinds of values a Node can take on at runtime - we call these Types, and we annotate Nodes with Types. The Type annotation serves two purposes: @@ -106,8 +109,8 @@ The Type annotation serves two purposes: * it defines the set of operations allowed on the Node * it defines the set of values the Node takes on -The Type itself is represented as a Java class; the Java classes are used as -convenient to represent the Type's structure; all types are subtypes of the +The Type itself is represented as a Java class; the Java classes provide a +convenient way to represent the Type's structure; all types are subtypes of the class `Type`. For now, we only have the following hierarchy of types: ``` @@ -116,7 +119,7 @@ Type ``` It turns out that the set of values associated with a Type at a specific Node -can be conveniently represented as a *lattice* +can be conveniently represented as a *lattice* [wiki/Lattice_(order)](https://en.wikipedia.org/wiki/Lattice_(order)). Our lattice has the following structure:  @@ -130,7 +133,7 @@ Our lattice elements can be one of three types: Node's value is **not** a compile time constant. An invariant of peephole optimizations is that the type of a Node always moves -*up* the lattice (towards "top"); peepholes are *pessmistic* assuming the worst +*up* the lattice (towards "top"); peepholes are *pessimistic* assuming the worst until they can prove better. A later *optimistic* optimization will start all Nodes at *top* and move Types *down* the lattice as eager assumptions are proven wrong. @@ -161,9 +164,9 @@ optimizes each node as it is built; it does not retain this entire intermediate  -* Control nodes appear as square boxes with yellow background -* Control edges are in bold red -* The edges from Constants to Start are shown in dotted lines as these are not true control edges +* Control nodes appear as rectangular boxes with pale yellow backgrounds +* Control edges are red and thicker than data edges +* The edges from Constants to Start are shown as dashed gray lines as these are not true control edges * We label each edge with its position in the node's list of inputs. @@ -177,7 +180,7 @@ To demonstrate how the optimisation works, let's consider the following code: ``` return 1+2; ``` -This is parsed as: +This is parsed as: ```java var lhs = parseMultiplication(); if (match("+")) return new AddNode(lhs, parseAddition()).peephole(); @@ -198,22 +201,22 @@ When the peephole is called on the AddNode node it first calls the compute funct return Type.BOTTOM; } ``` -In our case both of the operands(`1`, `2`) are constants, and instance of +In our case both of the operands(`1`, `2`) are constants, and instances of `TypeInteger`. Since `compute` returns a type, and we know that both of our operands are constants, we can do -constant propagation/folding where we compute the result of the expression so that instead of having `1+2` we can +constant propagation/folding where we compute the result of the expression so that instead of having `1+2` we can have `3`. -The 'TypeInteger' interface inherits from type but also has a field that stores the value observed for that type. +The `TypeInteger` class inherits from `Type` but also has a field that stores the value observed for that type. ```java - private final long _con + private final long _con; ``` AddNode has the layout:  -Since, we already know the value of both of the operands, we can just add them together and replace the +Since we already know the value of both of the operands, we can just add them together and replace the old node with a constant node that just holds the result of the expression. To do this - we have to recognize this happens when the type computed for the node is already a constant, but the node @@ -229,19 +232,19 @@ Note how we return a constant type when doing constant folding ```java return TypeInteger.constant(i0.value()+i1.value()); ``` -We can create a constant node in the following way: +We can create a constant node in the following way: ```java return new ConstantNode(type).peephole(); ``` -This recursively calls the peephole algorithm. +This recursively calls the peephole algorithm. Now, we end up with this:  -Notice, how we added the constant node holding a constant value of `3`. +Notice how we added the constant node holding a constant value of `3`. The remaining add node is unused and can be killed. -We can call the kill function before this way: +We can call the kill function first: ```java // Replace constant computations from non-constants with a constant node if (!(this instanceof ConstantNode) && type.isConstant()) { @@ -263,19 +266,19 @@ public void kill( ) { ``` `isUnused` - This makes sure the current node has no outputs. -Ideally, in our case there would be one output as the return statement is +Ideally, in our case there would be one output as the return statement is using the add expression. However, the optimisation happens before even creating the return node, which means that at this point there are no users of the add node. -We can now freely go ahead and delete the node. +We can now freely go ahead and delete the node. ```java for(int i=0; i<nIns(); i++ ) setDef(i,null); // Set all inputs to null, recursively killing unused Nodes _inputs.clear(); -_type=null; +_type=null; ``` We finally end up with this: diff --git a/chapter02/docs/02-demonstration-peephole.json b/chapter02/docs/02-demonstration-peephole.json new file mode 100644 index 00000000..f78a058e --- /dev/null +++ b/chapter02/docs/02-demonstration-peephole.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-demonstration-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 5, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-demonstration-peephole.svg b/chapter02/docs/02-demonstration-peephole.svg index 90ab6ca4..dfc03cff 100644 --- a/chapter02/docs/02-demonstration-peephole.svg +++ b/chapter02/docs/02-demonstration-peephole.svg @@ -1,54 +1,73 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter02 Pages: 1 --> -<svg width="114pt" height="220pt" viewBox="0.00 0.00 114.00 220.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 216)"> -<title>chapter02</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-216 110,-216 110,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-8 8,-204 98,-204 98,-8 8,-8"/> -</g> -<!-- Start1 --> -<g id="node1" class="node"> -<title>Start1</title> -<polygon fill="#ffff00" stroke="#000000" points="80,-196 26,-196 26,-160 80,-160 80,-196"/> -<text text-anchor="middle" x="53" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -</g> -<!-- Con_5 --> -<g id="node2" class="node"> -<title>Con_5</title> -<ellipse fill="none" stroke="#000000" cx="43" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-101.8" font-family="Times,serif" font-size="14.00" fill="#000000">#3</text> -</g> -<!-- Con_5->Start1 --> -<g id="edge1" class="edge"> -<title>Con_5->Start1</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M45.5234,-124.1686C46.5929,-131.869 47.8647,-141.0257 49.0532,-149.5834"/> -<polygon fill="#000000" stroke="#000000" points="45.6001,-150.1633 50.4426,-159.5867 52.5336,-149.2003 45.6001,-150.1633"/> -<text text-anchor="middle" x="43.2998" y="-126.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return6 --> -<g id="node3" class="node"> -<title>Return6</title> -<polygon fill="#ffff00" stroke="#000000" points="80.1025,-52 25.8975,-52 25.8975,-16 80.1025,-16 80.1025,-52"/> -<text text-anchor="middle" x="53" y="-29.8" font-family="Times,serif" font-size="14.00" fill="#000000">Return</text> -</g> -<!-- Return6->Start1 --> -<g id="edge2" class="edge"> -<title>Return6->Start1</title> -<path fill="none" stroke="#ff0000" d="M64.3196,-52.2322C69.9396,-62.3585 76.1294,-75.4211 79,-88 82.5597,-103.599 82.5597,-108.401 79,-124 76.9144,-133.1394 73.0765,-142.534 68.9781,-150.8724"/> -<polygon fill="#ff0000" stroke="#ff0000" points="65.8583,-149.2853 64.3196,-159.7678 72.0595,-152.5328 65.8583,-149.2853"/> -<text text-anchor="middle" x="62.096" y="-54.6322" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return6->Con_5 --> -<g id="edge3" class="edge"> -<title>Return6->Con_5</title> -<path fill="none" stroke="#000000" d="M50.4766,-52.1686C49.4071,-59.869 48.1353,-69.0257 46.9468,-77.5834"/> -<polygon fill="#000000" stroke="#000000" points="43.4664,-77.2003 45.5574,-87.5867 50.3999,-78.1633 43.4664,-77.2003"/> -<text text-anchor="middle" x="48.253" y="-54.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="320" height="208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e5i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[0] → #1 · ASSOC</title></path><path class="edge CTRL" id="e6i0" d="M84,80 L84,128" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[0] → #1 · CTRL</title></path><path class="edge DATA" id="e6i1" d="M236,80 L236,90 L124,90 L124,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#6[1] → #5 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 #3 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n6" data-id="6" transform="translate(44,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Return +Type not computed + +[0] → #1 CTRL +[1] → #5 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter02/docs/02-demonstration-pre-peephole-nokill.json b/chapter02/docs/02-demonstration-pre-peephole-nokill.json new file mode 100644 index 00000000..6a952f88 --- /dev/null +++ b/chapter02/docs/02-demonstration-pre-peephole-nokill.json @@ -0,0 +1,17 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-demonstration-pre-peephole-nokill.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}, {"idx": 2, "def": 3, "role": "DATA", "label": null}], "proj": null}, + {"id": 5, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-demonstration-pre-peephole-nokill.svg b/chapter02/docs/02-demonstration-pre-peephole-nokill.svg index 3d4f53df..a40e5981 100644 --- a/chapter02/docs/02-demonstration-pre-peephole-nokill.svg +++ b/chapter02/docs/02-demonstration-pre-peephole-nokill.svg @@ -1,100 +1,84 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter02 Pages: 1 --> -<svg width="258pt" height="220pt" viewBox="0.00 0.00 258.00 220.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 216)"> -<title>chapter02</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-216 254,-216 254,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-8 8,-204 242,-204 242,-8 8,-8"/> -</g> -<!-- Start1 --> -<g id="node1" class="node"> -<title>Start1</title> -<polygon fill="#ffff00" stroke="#000000" points="165,-196 111,-196 111,-160 165,-160 165,-196"/> -<text text-anchor="middle" x="138" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -</g> -<!-- Con_2 --> -<g id="node2" class="node"> -<title>Con_2</title> -<ellipse fill="none" stroke="#000000" cx="43" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-101.8" font-family="Times,serif" font-size="14.00" fill="#000000">#1</text> -</g> -<!-- Con_2->Start1 --> -<g id="edge1" class="edge"> -<title>Con_2->Start1</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M60.8688,-119.5426C73.5668,-129.1664 90.9688,-142.3553 106.03,-153.7701"/> -<polygon fill="#000000" stroke="#000000" points="104.028,-156.6444 114.1118,-159.8953 108.2562,-151.0656 104.028,-156.6444"/> -<text text-anchor="middle" x="58.6452" y="-121.9426" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_3 --> -<g id="node3" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="#000000" cx="115" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-101.8" font-family="Times,serif" font-size="14.00" fill="#000000">#2</text> -</g> -<!-- Con_3->Start1 --> -<g id="edge2" class="edge"> -<title>Con_3->Start1</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M120.6854,-123.7978C123.237,-131.7854 126.3069,-141.3955 129.1486,-150.2913"/> -<polygon fill="#000000" stroke="#000000" points="125.8432,-151.4462 132.2203,-159.9069 132.5113,-149.316 125.8432,-151.4462"/> -<text text-anchor="middle" x="118.4618" y="-126.1978" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Add4 --> -<g id="node4" class="node"> -<title>Add4</title> -<ellipse fill="none" stroke="#000000" cx="89" cy="-34" rx="27" ry="18"/> -<text text-anchor="middle" x="89" y="-29.8" font-family="Times,serif" font-size="14.00" fill="#000000">+</text> -</g> -<!-- Add4->Con_2 --> -<g id="edge3" class="edge"> -<title>Add4->Con_2</title> -<path fill="none" stroke="#000000" d="M78.3311,-50.6992C72.6414,-59.6048 65.5223,-70.7476 59.1684,-80.693"/> -<polygon fill="#000000" stroke="#000000" points="56.0456,-79.08 53.6111,-89.3913 61.9445,-82.8487 56.0456,-79.08"/> -<text text-anchor="middle" x="80.5547" y="-53.0992" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Add4->Con_3 --> -<g id="edge4" class="edge"> -<title>Add4->Con_3</title> -<path fill="none" stroke="#000000" d="M95.427,-51.7978C98.3866,-59.9936 101.963,-69.8976 105.2447,-78.9855"/> -<polygon fill="#000000" stroke="#000000" points="101.9585,-80.1902 108.647,-88.407 108.5424,-77.8126 101.9585,-80.1902"/> -<text text-anchor="middle" x="93.2034" y="-54.1978" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">2</text> -</g> -<!-- Con_5 --> -<g id="node5" class="node"> -<title>Con_5</title> -<ellipse fill="none" stroke="#000000" cx="207" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-101.8" font-family="Times,serif" font-size="14.00" fill="#000000">#3</text> -</g> -<!-- Con_5->Start1 --> -<g id="edge5" class="edge"> -<title>Con_5->Start1</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M192.3669,-121.2693C183.6447,-130.3708 172.3525,-142.1539 162.3214,-152.6212"/> -<polygon fill="#000000" stroke="#000000" points="159.6869,-150.3117 155.2947,-159.9533 164.7408,-155.1551 159.6869,-150.3117"/> -<text text-anchor="middle" x="194.5905" y="-123.6693" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return6 --> -<g id="node6" class="node"> -<title>Return6</title> -<polygon fill="#ffff00" stroke="#000000" points="211.1025,-52 156.8975,-52 156.8975,-16 211.1025,-16 211.1025,-52"/> -<text text-anchor="middle" x="184" y="-29.8" font-family="Times,serif" font-size="14.00" fill="#000000">Return</text> -</g> -<!-- Return6->Start1 --> -<g id="edge6" class="edge"> -<title>Return6->Start1</title> -<path fill="none" stroke="#ff0000" d="M178.1741,-52.2377C170.2935,-76.9072 156.1635,-121.1402 146.9358,-150.0269"/> -<polygon fill="#ff0000" stroke="#ff0000" points="143.4876,-149.3195 143.7786,-159.9104 150.1557,-151.4497 143.4876,-149.3195"/> -<text text-anchor="middle" x="175.9505" y="-54.6377" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return6->Con_5 --> -<g id="edge7" class="edge"> -<title>Return6->Con_5</title> -<path fill="none" stroke="#000000" d="M189.8039,-52.1686C192.3565,-60.1594 195.41,-69.7181 198.2308,-78.5486"/> -<polygon fill="#000000" stroke="#000000" points="194.9006,-79.6259 201.2777,-88.0866 201.5687,-77.4957 194.9006,-79.6259"/> -<text text-anchor="middle" x="187.5803" y="-54.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="624" height="208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 624 208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC</title></path><path class="edge ASSOC" id="e3i0" d="M84,77 C84,101 540,3 540,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #1 · ASSOC</title></path><path class="edge DATA" id="e4i1" d="M388,80 L388,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#4[1] → #2 · DATA</title></path><path class="edge DATA" id="e4i2" d="M540,80 L540,90 L418,90 L418,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#4[2] → #3 · DATA</title></path><path class="edge ASSOC" id="e5i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[0] → #1 · ASSOC</title></path><path class="edge CTRL" id="e6i0" d="M84,80 L84,128" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[0] → #1 · CTRL</title></path><path class="edge DATA" id="e6i1" d="M236,80 L236,90 L124,90 L124,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#6[1] → #5 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n2" data-id="2" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 #1 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n3" data-id="3" transform="translate(480,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #2 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(328,134)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 + +Type not computed + +[0] → — DATA +[1] → #2 DATA +[2] → #3 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n5" data-id="5" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 #3 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n6" data-id="6" transform="translate(44,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Return +Type not computed + +[0] → #1 CTRL +[1] → #5 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter02/docs/02-demonstration-pre-peephole.json b/chapter02/docs/02-demonstration-pre-peephole.json new file mode 100644 index 00000000..b29cf6dd --- /dev/null +++ b/chapter02/docs/02-demonstration-pre-peephole.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-demonstration-pre-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}, {"idx": 2, "def": 3, "role": "DATA", "label": null}], "proj": null}, + {"id": 5, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-demonstration-pre-peephole.svg b/chapter02/docs/02-demonstration-pre-peephole.svg index 49624652..8809a0c0 100644 --- a/chapter02/docs/02-demonstration-pre-peephole.svg +++ b/chapter02/docs/02-demonstration-pre-peephole.svg @@ -1,87 +1,81 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter02 Pages: 1 --> -<svg width="186pt" height="292pt" viewBox="0.00 0.00 186.00 292.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 288)"> -<title>chapter02</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-288 182,-288 182,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-8 8,-276 170,-276 170,-8 8,-8"/> -</g> -<!-- Start1 --> -<g id="node1" class="node"> -<title>Start1</title> -<polygon fill="#ffff00" stroke="#000000" points="90,-268 36,-268 36,-232 90,-232 90,-268"/> -<text text-anchor="middle" x="63" y="-245.8" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -</g> -<!-- Con_2 --> -<g id="node2" class="node"> -<title>Con_2</title> -<ellipse fill="none" stroke="#000000" cx="63" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">#1</text> -</g> -<!-- Con_2->Start1 --> -<g id="edge1" class="edge"> -<title>Con_2->Start1</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M63,-196.1686C63,-203.869 63,-213.0257 63,-221.5834"/> -<polygon fill="#000000" stroke="#000000" points="59.5001,-221.5867 63,-231.5867 66.5001,-221.5868 59.5001,-221.5867"/> -<text text-anchor="middle" x="60.7764" y="-198.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_3 --> -<g id="node3" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="#000000" cx="135" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">#2</text> -</g> -<!-- Con_3->Start1 --> -<g id="edge2" class="edge"> -<title>Con_3->Start1</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M119.7307,-193.2693C110.6292,-202.3708 98.8461,-214.1539 88.3788,-224.6212"/> -<polygon fill="#000000" stroke="#000000" points="85.6429,-222.4073 81.0467,-231.9533 90.5927,-227.3571 85.6429,-222.4073"/> -<text text-anchor="middle" x="117.5071" y="-195.6693" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Add4 --> -<g id="node4" class="node"> -<title>Add4</title> -<ellipse fill="none" stroke="#000000" cx="63" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-101.8" font-family="Times,serif" font-size="14.00" fill="#000000">+</text> -</g> -<!-- Add4->Con_2 --> -<g id="edge3" class="edge"> -<title>Add4->Con_2</title> -<path fill="none" stroke="#000000" d="M63,-124.1686C63,-131.869 63,-141.0257 63,-149.5834"/> -<polygon fill="#000000" stroke="#000000" points="59.5001,-149.5867 63,-159.5867 66.5001,-149.5868 59.5001,-149.5867"/> -<text text-anchor="middle" x="60.7764" y="-126.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Add4->Con_3 --> -<g id="edge4" class="edge"> -<title>Add4->Con_3</title> -<path fill="none" stroke="#000000" d="M78.2693,-121.2693C88.197,-131.197 101.3153,-144.3153 112.4363,-155.4363"/> -<polygon fill="#000000" stroke="#000000" points="110.2067,-158.1564 119.7527,-162.7527 115.1564,-153.2067 110.2067,-158.1564"/> -<text text-anchor="middle" x="80.4929" y="-123.6693" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">2</text> -</g> -<!-- Return5 --> -<g id="node5" class="node"> -<title>Return5</title> -<polygon fill="#ffff00" stroke="#000000" points="80.1025,-52 25.8975,-52 25.8975,-16 80.1025,-16 80.1025,-52"/> -<text text-anchor="middle" x="53" y="-29.8" font-family="Times,serif" font-size="14.00" fill="#000000">Return</text> -</g> -<!-- Return5->Start1 --> -<g id="edge5" class="edge"> -<title>Return5->Start1</title> -<path fill="none" stroke="#ff0000" d="M41.6804,-52.2322C36.0604,-62.3585 29.8706,-75.4211 27,-88 16.3208,-134.7969 13.0904,-150.0596 27,-196 29.9564,-205.7645 35.3252,-215.3771 41.03,-223.7238"/> -<polygon fill="#ff0000" stroke="#ff0000" points="38.2871,-225.9027 47.0095,-231.9169 43.9414,-221.7761 38.2871,-225.9027"/> -<text text-anchor="middle" x="39.4568" y="-54.6322" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return5->Add4 --> -<g id="edge6" class="edge"> -<title>Return5->Add4</title> -<path fill="none" stroke="#000000" d="M55.5234,-52.1686C56.5929,-59.869 57.8647,-69.0257 59.0532,-77.5834"/> -<polygon fill="#000000" stroke="#000000" points="55.6001,-78.1633 60.4426,-87.5867 62.5336,-77.2003 55.6001,-78.1633"/> -<text text-anchor="middle" x="53.2998" y="-54.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="350" height="312" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 350 312" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,181 C84,205 114,3 114,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC</title></path><path class="edge ASSOC" id="e3i0" d="M84,181 C84,205 266,3 266,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #1 · ASSOC</title></path><path class="edge DATA" id="e4i1" d="M114,80 L114,90 L236,90 L236,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#4[1] → #2 · DATA</title></path><path class="edge DATA" id="e4i2" d="M266,80 L266,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#4[2] → #3 · DATA</title></path><path class="edge CTRL" id="e5i0" d="M84,184 L84,232" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#5[0] → #1 · CTRL</title></path><path class="edge DATA" id="e5i1" d="M236,184 L236,194 L124,194 L124,232" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#5[1] → #4 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n2" data-id="2" transform="translate(54,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 #1 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n3" data-id="3" transform="translate(206,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #2 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(176,134)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 + +Type not computed + +[0] → — DATA +[1] → #2 DATA +[2] → #3 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n5" data-id="5" transform="translate(44,238)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 Return +Type not computed + +[0] → #1 CTRL +[1] → #4 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter02/docs/02-post-peephole-ex1.json b/chapter02/docs/02-post-peephole-ex1.json new file mode 100644 index 00000000..e9c6d1eb --- /dev/null +++ b/chapter02/docs/02-post-peephole-ex1.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-post-peephole-ex1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 14, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-post-peephole-ex1.svg b/chapter02/docs/02-post-peephole-ex1.svg index db27e30d..6674839e 100644 --- a/chapter02/docs/02-post-peephole-ex1.svg +++ b/chapter02/docs/02-post-peephole-ex1.svg @@ -1,56 +1,73 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter02 Pages: 1 --> -<svg width="114pt" height="220pt" - viewBox="0.00 0.00 114.00 220.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 216)"> -<title>chapter02</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-216 110,-216 110,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-204 98,-204 98,-8 8,-8"/> -</g> -<!-- Start1 --> -<g id="node1" class="node"> -<title>Start1</title> -<polygon fill="yellow" stroke="black" points="80,-196 26,-196 26,-160 80,-160 80,-196"/> -<text text-anchor="middle" x="53" y="-174.3" font-family="Times,serif" font-size="14.00">Start</text> -</g> -<!-- Con_13 --> -<g id="node2" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="43" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-102.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_13->Start1 --> -<g id="edge1" class="edge"> -<title>Con_13->Start1</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M45.42,-123.95C46.52,-131.65 47.85,-140.97 49.09,-149.64"/> -<polygon fill="black" stroke="black" points="45.65,-150.32 50.53,-159.72 52.58,-149.33 45.65,-150.32"/> -<text text-anchor="middle" x="42.42" y="-126.55" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return14 --> -<g id="node3" class="node"> -<title>Return14</title> -<polygon fill="yellow" stroke="black" points="86,-52 20,-52 20,-16 86,-16 86,-52"/> -<text text-anchor="middle" x="53" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return14->Start1 --> -<g id="edge2" class="edge"> -<title>Return14->Start1</title> -<path fill="none" stroke="red" d="M64.05,-52.39C69.74,-62.38 76.08,-75.42 79,-88 82.62,-103.59 82.62,-108.41 79,-124 76.9,-133.04 73.03,-142.32 68.91,-150.53"/> -<polygon fill="red" stroke="red" points="65.69,-149.14 64.05,-159.61 71.86,-152.45 65.69,-149.14"/> -<text text-anchor="middle" x="61.05" y="-54.99" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return14->Con_13 --> -<g id="edge3" class="edge"> -<title>Return14->Con_13</title> -<path fill="none" stroke="black" d="M50.53,-52.3C49.43,-60.02 48.1,-69.29 46.87,-77.89"/> -<polygon fill="black" stroke="black" points="43.39,-77.5 45.44,-87.9 50.32,-78.49 43.39,-77.5"/> -<text text-anchor="middle" x="47.53" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="320" height="208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e13i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#13[0] → #1 · ASSOC</title></path><path class="edge CTRL" id="e14i0" d="M84,80 L84,128" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #1 · CTRL</title></path><path class="edge DATA" id="e14i1" d="M236,80 L236,90 L124,90 L124,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #13 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n13" data-id="13" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #2 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n14" data-id="14" transform="translate(44,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 Return +Type not computed + +[0] → #1 CTRL +[1] → #13 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter02/docs/02-pre-peephole-ex1.json b/chapter02/docs/02-pre-peephole-ex1.json new file mode 100644 index 00000000..012bd814 --- /dev/null +++ b/chapter02/docs/02-pre-peephole-ex1.json @@ -0,0 +1,21 @@ +{ + "ver": 1, + "comp": "chapter02/docs/02-pre-peephole-ex1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 2, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 3, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 5, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 3, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 6, "label": "#5", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 2, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter02/docs/02-pre-peephole-ex1.svg b/chapter02/docs/02-pre-peephole-ex1.svg index 29c76bd8..e2e5f785 100644 --- a/chapter02/docs/02-pre-peephole-ex1.svg +++ b/chapter02/docs/02-pre-peephole-ex1.svg @@ -1,168 +1,101 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter02 Pages: 1 --> -<svg width="278pt" height="436pt" - viewBox="0.00 0.00 278.00 436.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 432)"> -<title>chapter02</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-432 274,-432 274,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-420 262,-420 262,-8 8,-8"/> -</g> -<!-- Start1 --> -<g id="node1" class="node"> -<title>Start1</title> -<polygon fill="yellow" stroke="black" points="162,-412 108,-412 108,-376 162,-376 162,-412"/> -<text text-anchor="middle" x="135" y="-390.3" font-family="Times,serif" font-size="14.00">Start</text> -</g> -<!-- Con_2 --> -<g id="node2" class="node"> -<title>Con_2</title> -<ellipse fill="none" stroke="black" cx="222" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="222" y="-174.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Con_2->Start1 --> -<g id="edge1" class="edge"> -<title>Con_2->Start1</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M230.65,-195.54C245.5,-226.47 271.62,-294.07 243,-340 227.56,-364.77 196.8,-378.29 172.04,-385.46"/> -<polygon fill="black" stroke="black" points="170.97,-382.13 162.2,-388.08 172.77,-388.89 170.97,-382.13"/> -<text text-anchor="middle" x="227.65" y="-198.14" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_3 --> -<g id="node3" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="black" cx="63" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-318.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_3->Start1 --> -<g id="edge2" class="edge"> -<title>Con_3->Start1</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M77.57,-337.17C86.92,-346.25 99.3,-358.29 110.17,-368.86"/> -<polygon fill="black" stroke="black" points="107.79,-371.43 117.4,-375.89 112.67,-366.41 107.79,-371.43"/> -<text text-anchor="middle" x="74.57" y="-339.77" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="135" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-318.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Con_4->Start1 --> -<g id="edge3" class="edge"> -<title>Con_4->Start1</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M135,-340.3C135,-348.02 135,-357.29 135,-365.89"/> -<polygon fill="black" stroke="black" points="131.5,-365.9 135,-375.9 138.5,-365.9 131.5,-365.9"/> -<text text-anchor="middle" x="132" y="-342.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Mul5 --> -<g id="node5" class="node"> -<title>Mul5</title> -<ellipse fill="none" stroke="black" cx="135" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-246.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Mul5->Con_3 --> -<g id="edge4" class="edge"> -<title>Mul5->Con_3</title> -<path fill="none" stroke="black" d="M120.43,-265.17C110.25,-275.06 96.48,-288.45 84.97,-299.64"/> -<polygon fill="black" stroke="black" points="82.53,-297.13 77.8,-306.62 87.41,-302.15 82.53,-297.13"/> -<text text-anchor="middle" x="117.43" y="-267.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Mul5->Con_4 --> -<g id="edge5" class="edge"> -<title>Mul5->Con_4</title> -<path fill="none" stroke="black" d="M135,-268.3C135,-276.02 135,-285.29 135,-293.89"/> -<polygon fill="black" stroke="black" points="131.5,-293.9 135,-303.9 138.5,-293.9 131.5,-293.9"/> -<text text-anchor="middle" x="132" y="-270.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_6 --> -<g id="node6" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="207" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-318.3" font-family="Times,serif" font-size="14.00">#5</text> -</g> -<!-- Con_6->Start1 --> -<g id="edge6" class="edge"> -<title>Con_6->Start1</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M192.43,-337.17C183.08,-346.25 170.7,-358.29 159.83,-368.86"/> -<polygon fill="black" stroke="black" points="157.33,-366.41 152.6,-375.89 162.21,-371.43 157.33,-366.41"/> -<text text-anchor="middle" x="189.43" y="-339.77" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Minus7 --> -<g id="node7" class="node"> -<title>Minus7</title> -<ellipse fill="none" stroke="black" cx="207" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-246.3" font-family="Times,serif" font-size="14.00">-</text> -</g> -<!-- Minus7->Con_6 --> -<g id="edge7" class="edge"> -<title>Minus7->Con_6</title> -<path fill="none" stroke="black" d="M207,-268.3C207,-276.02 207,-285.29 207,-293.89"/> -<polygon fill="black" stroke="black" points="203.5,-293.9 207,-303.9 210.5,-293.9 203.5,-293.9"/> -<text text-anchor="middle" x="204" y="-270.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add8 --> -<g id="node8" class="node"> -<title>Add8</title> -<ellipse fill="none" stroke="black" cx="140" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="140" y="-174.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add8->Mul5 --> -<g id="edge8" class="edge"> -<title>Add8->Mul5</title> -<path fill="none" stroke="black" d="M138.76,-196.3C138.21,-204.02 137.55,-213.29 136.94,-221.89"/> -<polygon fill="black" stroke="black" points="133.44,-221.67 136.22,-231.9 140.43,-222.17 133.44,-221.67"/> -<text text-anchor="middle" x="135.76" y="-198.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add8->Minus7 --> -<g id="edge9" class="edge"> -<title>Add8->Minus7</title> -<path fill="none" stroke="black" d="M153.88,-193.5C163.14,-203.17 175.47,-216.06 185.93,-226.98"/> -<polygon fill="black" stroke="black" points="183.69,-229.71 193.14,-234.51 188.75,-224.87 183.69,-229.71"/> -<text text-anchor="middle" x="150.88" y="-196.1" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add9 --> -<g id="node9" class="node"> -<title>Add9</title> -<ellipse fill="none" stroke="black" cx="140" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="140" y="-102.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add9->Con_2 --> -<g id="edge10" class="edge"> -<title>Add9->Con_2</title> -<path fill="none" stroke="black" d="M156.2,-120.83C168.18,-131.06 184.69,-145.15 198.18,-156.66"/> -<polygon fill="black" stroke="black" points="196.23,-159.61 206.11,-163.44 200.78,-154.28 196.23,-159.61"/> -<text text-anchor="middle" x="153.2" y="-123.43" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add9->Add8 --> -<g id="edge11" class="edge"> -<title>Add9->Add8</title> -<path fill="none" stroke="black" d="M140,-124.3C140,-132.02 140,-141.29 140,-149.89"/> -<polygon fill="black" stroke="black" points="136.5,-149.9 140,-159.9 143.5,-149.9 136.5,-149.9"/> -<text text-anchor="middle" x="137" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return10 --> -<g id="node10" class="node"> -<title>Return10</title> -<polygon fill="yellow" stroke="black" points="125,-52 59,-52 59,-16 125,-16 125,-52"/> -<text text-anchor="middle" x="92" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return10->Start1 --> -<g id="edge12" class="edge"> -<title>Return10->Start1</title> -<path fill="none" stroke="red" d="M75.73,-52.27C53.67,-77.55 17,-127.09 17,-177 17,-177 17,-177 17,-251 17,-290.8 4.09,-307.45 27,-340 43.69,-363.72 74.05,-377.3 98.34,-384.76"/> -<polygon fill="red" stroke="red" points="97.41,-388.14 107.99,-387.51 99.33,-381.4 97.41,-388.14"/> -<text text-anchor="middle" x="72.73" y="-54.87" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return10->Add9 --> -<g id="edge13" class="edge"> -<title>Return10->Add9</title> -<path fill="none" stroke="black" d="M103.87,-52.3C109.82,-60.98 117.12,-71.63 123.6,-81.08"/> -<polygon fill="black" stroke="black" points="120.71,-83.06 129.25,-89.33 126.49,-79.1 120.71,-83.06"/> -<text text-anchor="middle" x="100.87" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="472" height="520" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 472 520" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M146,389 C146,413 176,211 176,235" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC</title></path><path class="edge ASSOC" id="e3i0" d="M146,389 C146,413 84,3 84,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #1 · ASSOC</title></path><path class="edge ASSOC" id="e4i0" d="M146,389 C146,413 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #1 · ASSOC</title></path><path class="edge DATA" id="e5i1" d="M84,80 L84,90 L206,90 L206,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#5[1] → #3 · DATA</title></path><path class="edge DATA" id="e5i2" d="M236,80 L236,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#5[2] → #4 · DATA</title></path><path class="edge ASSOC" id="e6i0" d="M146,389 C146,413 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#6[0] → #1 · ASSOC</title></path><path class="edge DATA" id="e7i1" d="M388,80 L388,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #6 · DATA</title></path><path class="edge DATA" id="e8i1" d="M206,184 L206,194 L328,194 L328,232" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #5 · DATA</title></path><path class="edge DATA" id="e8i2" d="M368,184 L368,194 L358,194 L358,232" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge DATA" id="e9i1" d="M176,288 L176,298 L298,298 L298,336" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #2 · DATA</title></path><path class="edge DATA" id="e9i2" d="M328,288 L328,336" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #8 · DATA</title></path><path class="edge CTRL" id="e10i0" d="M146,392 L146,440" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #1 · CTRL</title></path><path class="edge DATA" id="e10i1" d="M298,392 L298,402 L186,402 L186,440" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(86,342)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Start +Type not computed + +</title></g><g class="node" id="n2" data-id="2" transform="translate(116,238)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 #1 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n3" data-id="3" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #2 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #3 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n5" data-id="5" transform="translate(146,134)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 * +Type not computed + +[0] → — DATA +[1] → #3 DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n6" data-id="6" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #5 +Type not computed + +[0] → #1 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n7" data-id="7" transform="translate(308,134)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 - +Type not computed + +[0] → — DATA +[1] → #6 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="white"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n8" data-id="8" transform="translate(268,238)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(238,342)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 + +Type not computed + +[0] → — DATA +[1] → #2 DATA +[2] → #8 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(106,446)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 Return +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter02/docs/Makefile b/chapter02/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter02/docs/Makefile +++ b/chapter02/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter02/src/main/java/com/seaofnodes/simple/type/Type.java b/chapter02/src/main/java/com/seaofnodes/simple/type/Type.java index 7ea17bfb..b98ce6de 100644 --- a/chapter02/src/main/java/com/seaofnodes/simple/type/Type.java +++ b/chapter02/src/main/java/com/seaofnodes/simple/type/Type.java @@ -36,5 +36,10 @@ public class Type { public boolean isConstant() { return _type == TTOP; } + @Override + public String toString() { + return print(new StringBuilder()).toString(); + } + public StringBuilder print(StringBuilder sb) {return is_simple() ? sb.append(STRS[_type]) : sb;} } diff --git a/chapter03/README.md b/chapter03/README.md index e8944e12..5998efad 100644 --- a/chapter03/README.md +++ b/chapter03/README.md @@ -1,13 +1,15 @@ # Chapter 3: Variable Declarations +[Previous: Chapter 2](../chapter02/README.md) | +[Next: Chapter 4](../chapter04/README.md) + # Table of Contents 1. [Extensions to Intermediate Representation](#extensions-to-intermediate-representation) 2. [Symbol Tables](#symbol-tables) 3. [ScopeNode](#scopenode) 4. [Demonstration](#demonstration) -5. [Identification of Basic Blocks in SoN graph](#identification-of-basic-blocks-in-son-graph) -6. [Enabling peephole optimizations](#enabling-peephole-optimizations) +5. [Enabling peephole optimizations](#enabling-peephole-optimizations) You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter03) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter02...linear-chapter03) it to the previous chapter. @@ -29,7 +31,7 @@ Here is the [complete language grammar](docs/03-grammar.md) for this chapter. ## Extensions to Intermediate Representation -To recap, our list of Nodes are: +To recap, our list of Nodes is: | Node Name | Type | Description | Inputs | Value | |-----------|---------|------------------------------------|------------------------------------------------------------------|-------------------------------------------------------| @@ -67,17 +69,17 @@ the stack of symbol tables, in lexical order. A ScopeNode encapsulates the stack of symbol tables that are used to implement lexical scopes. -* The nodes referenced by the names in a lexical scope become inputs to the ScopeNode; this makes ScopeNode a user of these values, thus keeping them alive while a particular lexical scope is alive. - When the lexical scope ends, those inputs are removed. This is crucial because peepholes will remove dead Nodes and every new Node is effectively dead at the instance of creation without such a reference. -* In [Chapter 5](../chapter05/README.md) when we implement branches, the ScopeNode gets duplicated at a branch point and then gets merged when the branch joins. This allows - the names to evolve in each branch independently. At the merge point names that have diverged require a Phi node. +* The nodes referenced by the names in a lexical scope become inputs to the ScopeNode; this makes ScopeNode a user of these values, thus keeping them alive while a particular lexical scope is alive. + When the lexical scope ends, those inputs are removed. This is crucial because peepholes will remove dead Nodes and every new Node is effectively dead at the instant of creation without such a reference. +* In [Chapter 5](../chapter05/README.md) when we implement branches, the ScopeNode gets duplicated at a branch point and then gets merged when the branch joins. This allows + the names to evolve in each branch independently. At the merge point names that have diverged require a Phi node. * In [Chapter 7](../chapter07/README.md) additional logic is deployed for handling Phis from back edges. * The ScopeNode is used to track some other values such as the Control token starting from [Chapter 4](../chapter04/README.md), and whole memory starting from [Chapter 10a](../chapter10a/README.md). Special name bindings are used for these, and each name is tracked across branches and then merged at merge points. * In [Chapter 10a](../chapter10a/README.md) the ScopeNode is enhanced to also maintain the declared type for each name. From an implementation standpoint, each symbol table is represented as a `HashMap<String,Integer>`, where the `String` is the variable name, and the `Integer` is an index into the inputs of the -ScopeNode. To access the Node associated with a name, first the symbol table is consulted, and then the ScopeNode's inputs to find the required Node. +ScopeNode. To access the Node associated with a name, first the symbol table is consulted, and then the ScopeNode's inputs to find the required Node. The stack of symbol tables is represented as `Stack<HashMap<String,Integer>>`. When a lexical scope is exited, we not only pop the symbol table representing the @@ -93,9 +95,9 @@ that uses the variable) this is when the expression dies: ``` -In the visualization, we show the ScopeNode in a separate box running -underneath the main IR graph; the stack of symbol tables is shown inside the -box. We show the edge from each variable in the symbol table to the defining +In the visualization, we show the ScopeNode in a separate purple box. Each +binding is labelled with its lexical scope level. We show the edge from each +variable in the symbol table to the defining Node in the graph. The ScopeNode is neither a Data Node nor a Control Node; it really is a utility for maintaining symbol tables, name lookups, plays a crucial role in deciding where Phi nodes are required. @@ -105,7 +107,7 @@ A ScopeNode has no outputs. ## Demonstration -We show the output from following code. +We show the output from the following code. ``` 01 int a=1; @@ -118,7 +120,7 @@ We show the output from following code. 09 return c; ``` -* When we start parsing above, we start with a symbol table (at level 0). +* When we start parsing the example above, we start with a symbol table (at level 0). The variables `a`, `b`, and `c` are registered in this table. * On line 4, we start a nested scope. At this point, a new symbol table is pushed (at level 1). * On line 5, a variable `b` is declared. `b` is registered in the symbol table at level 1. This then @@ -130,8 +132,8 @@ result of this example is `return 4;`.  -The diagram shows the ScopeNode and the symbol tables in the bottom cluster. -Each table is annotated by its scope level, and shows the variables defined in that scope. +The diagram shows the ScopeNode's bindings with their scope levels. The two +bindings for `b` belong to different lexical scopes. * When we exit the nested scope on line 8, the symbol table at level 1 is popped. * At line 9, our graph looks like this: @@ -140,43 +142,43 @@ Each table is annotated by its scope level, and shows the variables defined in t As we see, only 1 symbol table is present at this point. -We can also have multiple scopes at the same level during the execution of the program, -but only one will be active at a time because the symbol table can only hold one symbol table +We can also have multiple scopes at the same level during the execution of the program, +but only one will be active at a time because the symbol table can only hold one symbol table for each scope level. For example: ``` -01 int a=1; -02 int b=2; -03 int c=0; -04 { -05 int b=5; -06 c=a+b; -08 } +01 int a=1; +02 int b=2; +03 int c=0; +04 { +05 int b=5; +06 c=a+b; +08 } 09 { -10 int e=6; -11 c = a+e; -13 } -14 return c; +10 int e=6; +11 c = a+e; +13 } +14 return c; ``` Here both scopes starting from `(04-08)` and `(09-13)` are at the same level: ```java public final Stack<HashMap<String, Integer>> _scopes; ``` -The `_scopes` stack holds nested scopes, with index 0 representing the highest (global) -scope and deeper indices representing more nested scopes. -Popping returns the current scope and moves to the outer one. +The `_scopes` stack holds nested scopes, with index 0 representing the highest (global) +scope and deeper indices representing more nested scopes. +Popping returns the current scope and moves to the outer one. There is a direct one-to-one mapping between each index and its corresponding scope. -The first nested scope(04-08): +The first nested scope (04-08):  -The second nested scope(09-13): +The second nested scope (09-13):  - - In both cases the index which represents the deepness of the scope is 1. + - In both cases the index which represents the depth of the scope is 1. ## Enabling peephole optimizations Once we enable peephole optimizations, the parser is able to reduce all the expressions down to a @@ -190,7 +192,7 @@ constant. This is illustrated nicely below. 05 return (x0-x1)*(x0-x1) + (y0-y1)*(y0-y1); ``` -The graph for above, is displayed below. +The graph for the example above is displayed below.  diff --git a/chapter03/docs/03-graph1.json b/chapter03/docs/03-graph1.json new file mode 100644 index 00000000..5dce5431 --- /dev/null +++ b/chapter03/docs/03-graph1.json @@ -0,0 +1,17 @@ +{ + "ver": 1, + "comp": "chapter03/docs/03-graph1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 3, "role": "ASSOC", "label": "0: a"}, {"idx": 1, "def": 4, "role": "ASSOC", "label": "0: b"}, {"idx": 2, "def": 7, "role": "ASSOC", "label": "0: c"}, {"idx": 3, "def": 6, "role": "ASSOC", "label": "1: b"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 3, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter03/docs/03-graph1.svg b/chapter03/docs/03-graph1.svg index ab6f9600..9ad933d5 100644 --- a/chapter03/docs/03-graph1.svg +++ b/chapter03/docs/03-graph1.svg @@ -1,136 +1,86 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter03 Pages: 1 --> -<svg width="238pt" height="300pt" - viewBox="0.00 0.00 238.00 300.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 296)"> -<title>chapter03</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-296 234,-296 234,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-88 8,-284 222,-284 222,-88 8,-88"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="36,-8 36,-76 210,-76 210,-8 36,-8"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="132,-16 132,-68 202,-68 202,-16 132,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="black" points="142,-276 88,-276 88,-240 142,-240 142,-276"/> -<text text-anchor="middle" x="115" y="-254.3" font-family="Times,serif" font-size="14.00">Start</text> -</g> -<!-- Con_3 --> -<g id="node2" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="black" cx="43" cy="-186" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-182.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Con_3->Start2 --> -<g id="edge1" class="edge"> -<title>Con_3->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M57.57,-201.17C66.92,-210.25 79.3,-222.29 90.17,-232.86"/> -<polygon fill="black" stroke="black" points="87.79,-235.43 97.4,-239.89 92.67,-230.41 87.79,-235.43"/> -<text text-anchor="middle" x="54.57" y="-203.77" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node3" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="115" cy="-186" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-182.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_4->Start2 --> -<g id="edge2" class="edge"> -<title>Con_4->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M115,-204.3C115,-212.02 115,-221.29 115,-229.89"/> -<polygon fill="black" stroke="black" points="111.5,-229.9 115,-239.9 118.5,-229.9 111.5,-229.9"/> -<text text-anchor="middle" x="112" y="-206.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node4" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="187" cy="-186" rx="27" ry="18"/> -<text text-anchor="middle" x="187" y="-182.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Con_6->Start2 --> -<g id="edge3" class="edge"> -<title>Con_6->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M172.43,-201.17C163.08,-210.25 150.7,-222.29 139.83,-232.86"/> -<polygon fill="black" stroke="black" points="137.33,-230.41 132.6,-239.89 142.21,-235.43 137.33,-230.41"/> -<text text-anchor="middle" x="169.43" y="-203.77" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add7 --> -<g id="node5" class="node"> -<title>Add7</title> -<ellipse fill="none" stroke="black" cx="136" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="136" y="-110.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add7->Con_3 --> -<g id="edge4" class="edge"> -<title>Add7->Con_3</title> -<path fill="none" stroke="black" d="M118.51,-128.17C104.48,-138.73 84.58,-153.7 68.74,-165.63"/> -<polygon fill="black" stroke="black" points="66.3,-163.08 60.41,-171.89 70.51,-168.68 66.3,-163.08"/> -<text text-anchor="middle" x="115.51" y="-130.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add7->Con_6 --> -<g id="edge5" class="edge"> -<title>Add7->Con_6</title> -<path fill="none" stroke="black" d="M147.32,-130.54C153.92,-139.6 162.38,-151.21 169.8,-161.39"/> -<polygon fill="black" stroke="black" points="167,-163.49 175.71,-169.51 172.65,-159.36 167,-163.49"/> -<text text-anchor="middle" x="144.32" y="-133.14" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Scope1_0 --> -<g id="node6" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="53,-31 53,-52 69,-52 69,-31 53,-31"/> -<polygon fill="none" stroke="black" points="53,-31 53,-52 69,-52 69,-31 53,-31"/> -<text text-anchor="start" x="56" y="-37.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="69,-31 69,-52 84,-52 84,-31 69,-31"/> -<text text-anchor="start" x="72" y="-37.8" font-family="Times,serif" font-size="14.00">a</text> -<polygon fill="none" stroke="black" points="84,-31 84,-52 100,-52 100,-31 84,-31"/> -<text text-anchor="start" x="87" y="-37.8" font-family="Times,serif" font-size="14.00">b</text> -<polygon fill="none" stroke="black" points="100,-31 100,-52 114,-52 114,-31 100,-31"/> -<text text-anchor="start" x="103" y="-37.8" font-family="Times,serif" font-size="14.00">c</text> -</g> -<!-- Scope1_0->Con_3 --> -<g id="edge6" class="edge"> -<title>Scope1_0:Scope1_0_a->Con_3</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M76,-53C76,-90.54 63.29,-132.33 53.64,-158.64"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="50.27,-157.66 50,-168.25 56.81,-160.14 50.27,-157.66"/> -</g> -<!-- Scope1_0->Con_4 --> -<g id="edge7" class="edge"> -<title>Scope1_0:Scope1_0_b->Con_4</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M92,-53C92,-88.29 93.39,-97.33 100,-132 101.65,-140.68 104.07,-150 106.48,-158.37"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="103.14,-159.42 109.37,-168 109.85,-157.41 103.14,-159.42"/> -</g> -<!-- Scope1_0->Add7 --> -<g id="edge8" class="edge"> -<title>Scope1_0:Scope1_0_c->Add7</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M107,-53C107,-65.71 112.34,-78.55 118.43,-89.08"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="115.57,-91.1 123.87,-97.68 121.48,-87.35 115.57,-91.1"/> -</g> -<!-- Scope1_1 --> -<g id="node7" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="151,-31 151,-52 167,-52 167,-31 151,-31"/> -<polygon fill="none" stroke="black" points="151,-31 151,-52 167,-52 167,-31 151,-31"/> -<text text-anchor="start" x="154" y="-37.8" font-family="Times,serif" font-size="14.00">1</text> -<polygon fill="none" stroke="black" points="167,-31 167,-52 183,-52 183,-31 167,-31"/> -<text text-anchor="start" x="170" y="-37.8" font-family="Times,serif" font-size="14.00">b</text> -</g> -<!-- Scope1_1->Con_6 --> -<g id="edge9" class="edge"> -<title>Scope1_1:Scope1_1_b->Con_6</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M175,-53C175,-89.4 179.58,-131.23 183.08,-157.87"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="179.64,-158.52 184.46,-167.96 186.58,-157.58 179.64,-158.52"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="888" height="208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 888 208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 696,74 696,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a</title></path><path class="edge ASSOC" id="e1i1" d="M388,77 C388,101 744,74 744,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #4 · ASSOC · 0: b</title></path><path class="edge ASSOC" id="e1i2" d="M236,181 C236,205 792,74 792,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #7 · ASSOC · 0: c</title></path><path class="edge ASSOC" id="e1i3" d="M540,77 C540,101 840,74 840,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[3] → #6 · ASSOC · 1: b</title></path><path class="edge ASSOC" id="e3i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e4i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e6i0" d="M84,77 C84,101 540,3 540,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#6[0] → #2 · ASSOC</title></path><path class="edge DATA" id="e7i1" d="M236,80 L236,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #3 · DATA</title></path><path class="edge DATA" id="e7i2" d="M540,80 L540,90 L266,90 L266,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[2] → #6 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(672,98)" style="opacity: 1;"><path class="box" d="M4,0H188Q192,0 192,4V52Q192,56 188,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="96" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="96"/><title>#1 Scope +Type not computed + +[0] → #3 ASSOC 0: a +[1] → #4 ASSOC 0: b +[2] → #7 ASSOC 0: c +[3] → #6 ASSOC 1: b</title><line class="row" x1="0" x2="192" y1="30" y2="30"/><line class="row" x1="48" x2="48" y1="0" y2="30"/><line class="row" x1="96" x2="96" y1="0" y2="30"/><line class="row" x1="144" x2="144" y1="0" y2="30"/><text class="bind" x="24" y="20" text-anchor="middle">0: a</text><text class="bind" x="72" y="20" text-anchor="middle">0: b</text><text class="bind" x="120" y="20" text-anchor="middle">0: c</text><text class="bind" x="168" y="20" text-anchor="middle">1: b</text><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="72" cy="0" r="3" fill="#536477"/><circle class="port" cx="120" cy="0" r="3" fill="#536477"/><circle class="port" cx="168" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="72" y="-7" text-anchor="middle">1</text><text class="slot" x="120" y="-7" text-anchor="middle">2</text><text class="slot" x="168" y="-7" text-anchor="middle">3</text></g><g class="node" id="n2" data-id="2" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #1 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #2 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n6" data-id="6" transform="translate(480,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #3 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n7" data-id="7" transform="translate(176,134)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 + +Type not computed + +[0] → — DATA +[1] → #3 DATA +[2] → #6 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter03/docs/03-graph2.json b/chapter03/docs/03-graph2.json new file mode 100644 index 00000000..80397161 --- /dev/null +++ b/chapter03/docs/03-graph2.json @@ -0,0 +1,18 @@ +{ + "ver": 1, + "comp": "chapter03/docs/03-graph2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 3, "role": "ASSOC", "label": "0: a"}, {"idx": 1, "def": 4, "role": "ASSOC", "label": "0: b"}, {"idx": 2, "def": 7, "role": "ASSOC", "label": "0: c"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 3, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter03/docs/03-graph2.svg b/chapter03/docs/03-graph2.svg index 0a539c6a..d59e5dc0 100644 --- a/chapter03/docs/03-graph2.svg +++ b/chapter03/docs/03-graph2.svg @@ -1,137 +1,89 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter03 Pages: 1 --> -<svg width="360pt" height="292pt" - viewBox="0.00 0.00 360.00 292.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 288)"> -<title>chapter03</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-288 356,-288 356,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-276 242,-276 242,-8 8,-8"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="250,-8 250,-60 344,-60 344,-8 250,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="black" points="126,-268 72,-268 72,-232 126,-232 126,-268"/> -<text text-anchor="middle" x="99" y="-246.3" font-family="Times,serif" font-size="14.00">Start</text> -</g> -<!-- Con_3 --> -<g id="node2" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="black" cx="135" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-174.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Con_3->Start2 --> -<g id="edge1" class="edge"> -<title>Con_3->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M126.65,-195.24C122.46,-203.39 117.27,-213.47 112.53,-222.69"/> -<polygon fill="black" stroke="black" points="109.27,-221.38 107.81,-231.88 115.49,-224.58 109.27,-221.38"/> -<text text-anchor="middle" x="123.65" y="-197.84" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node3" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="207" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-174.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_4->Start2 --> -<g id="edge2" class="edge"> -<title>Con_4->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M188.19,-191.19C173.23,-200.89 151.89,-214.72 133.84,-226.42"/> -<polygon fill="black" stroke="black" points="131.77,-223.59 125.28,-231.97 135.58,-229.46 131.77,-223.59"/> -<text text-anchor="middle" x="185.19" y="-193.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node4" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="63" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-174.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Con_6->Start2 --> -<g id="edge3" class="edge"> -<title>Con_6->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M71.35,-195.24C75.54,-203.39 80.73,-213.47 85.47,-222.69"/> -<polygon fill="black" stroke="black" points="82.51,-224.58 90.19,-231.88 88.73,-221.38 82.51,-224.58"/> -<text text-anchor="middle" x="68.35" y="-197.84" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add7 --> -<g id="node5" class="node"> -<title>Add7</title> -<ellipse fill="none" stroke="black" cx="71" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="71" y="-102.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add7->Con_3 --> -<g id="edge4" class="edge"> -<title>Add7->Con_3</title> -<path fill="none" stroke="black" d="M84.57,-121.85C93.31,-131.4 104.83,-144.01 114.66,-154.75"/> -<polygon fill="black" stroke="black" points="112.12,-157.16 121.45,-162.18 117.28,-152.43 112.12,-157.16"/> -<text text-anchor="middle" x="81.57" y="-124.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add7->Con_6 --> -<g id="edge5" class="edge"> -<title>Add7->Con_6</title> -<path fill="none" stroke="black" d="M69.02,-124.3C68.14,-132.02 67.08,-141.29 66.1,-149.89"/> -<polygon fill="black" stroke="black" points="62.61,-149.56 64.95,-159.9 69.57,-150.36 62.61,-149.56"/> -<text text-anchor="middle" x="66.02" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return8 --> -<g id="node6" class="node"> -<title>Return8</title> -<polygon fill="yellow" stroke="black" points="89,-52 23,-52 23,-16 89,-16 89,-52"/> -<text text-anchor="middle" x="56" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return8->Start2 --> -<g id="edge6" class="edge"> -<title>Return8->Start2</title> -<path fill="none" stroke="red" d="M46.1,-52.47C30.13,-83.17 2.78,-148.1 27,-196 34.7,-211.23 49.06,-223.15 62.94,-231.8"/> -<polygon fill="red" stroke="red" points="61.52,-235.02 71.92,-237.01 65.03,-228.96 61.52,-235.02"/> -<text text-anchor="middle" x="43.1" y="-55.07" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return8->Add7 --> -<g id="edge7" class="edge"> -<title>Return8->Add7</title> -<path fill="none" stroke="black" d="M59.71,-52.3C61.36,-60.02 63.35,-69.29 65.19,-77.89"/> -<polygon fill="black" stroke="black" points="61.82,-78.85 67.33,-87.9 68.66,-77.38 61.82,-78.85"/> -<text text-anchor="middle" x="56.71" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Scope1_0 --> -<g id="node7" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="267,-23 267,-44 283,-44 283,-23 267,-23"/> -<polygon fill="none" stroke="black" points="267,-23 267,-44 283,-44 283,-23 267,-23"/> -<text text-anchor="start" x="270" y="-29.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="283,-23 283,-44 298,-44 298,-23 283,-23"/> -<text text-anchor="start" x="286" y="-29.8" font-family="Times,serif" font-size="14.00">a</text> -<polygon fill="none" stroke="black" points="298,-23 298,-44 314,-44 314,-23 298,-23"/> -<text text-anchor="start" x="301" y="-29.8" font-family="Times,serif" font-size="14.00">b</text> -<polygon fill="none" stroke="black" points="314,-23 314,-44 328,-44 328,-23 314,-23"/> -<text text-anchor="start" x="317" y="-29.8" font-family="Times,serif" font-size="14.00">c</text> -</g> -<!-- Scope1_0->Con_3 --> -<g id="edge8" class="edge"> -<title>Scope1_0:Scope1_0_a->Con_3</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M290,-45C290,-77.9 208.02,-132.76 163.3,-160.24"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="161.36,-157.33 154.63,-165.51 164.99,-163.31 161.36,-157.33"/> -</g> -<!-- Scope1_0->Con_4 --> -<g id="edge9" class="edge"> -<title>Scope1_0:Scope1_0_b->Con_4</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M306,-45C306,-93.23 263.17,-135.12 233.85,-158.15"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="231.47,-155.56 225.62,-164.4 235.7,-161.14 231.47,-155.56"/> -</g> -<!-- Scope1_0->Add7 --> -<g id="edge10" class="edge"> -<title>Scope1_0:Scope1_0_c->Add7</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M321,-45C321,-86.77 178.58,-78.08 138,-88 127.51,-90.56 116.11,-93.43 105.75,-96.06"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="104.62,-92.74 95.79,-98.6 106.35,-99.52 104.62,-92.74"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="840" height="312" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 840 312" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 696,74 696,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a</title></path><path class="edge ASSOC" id="e1i1" d="M388,77 C388,101 744,74 744,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #4 · ASSOC · 0: b</title></path><path class="edge ASSOC" id="e1i2" d="M236,181 C236,205 792,74 792,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #7 · ASSOC · 0: c</title></path><path class="edge ASSOC" id="e3i0" d="M84,181 C84,205 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e4i0" d="M84,181 C84,205 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e6i0" d="M84,181 C84,205 540,3 540,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#6[0] → #2 · ASSOC</title></path><path class="edge DATA" id="e7i1" d="M236,80 L236,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #3 · DATA</title></path><path class="edge DATA" id="e7i2" d="M540,80 L540,90 L266,90 L266,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[2] → #6 · DATA</title></path><path class="edge CTRL" id="e8i0" d="M84,184 L84,232" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[0] → #2 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M236,184 L236,194 L124,194 L124,232" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #7 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(672,98)" style="opacity: 1;"><path class="box" d="M4,0H140Q144,0 144,4V52Q144,56 140,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="72" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="72"/><title>#1 Scope +Type not computed + +[0] → #3 ASSOC 0: a +[1] → #4 ASSOC 0: b +[2] → #7 ASSOC 0: c</title><line class="row" x1="0" x2="144" y1="30" y2="30"/><line class="row" x1="48" x2="48" y1="0" y2="30"/><line class="row" x1="96" x2="96" y1="0" y2="30"/><text class="bind" x="24" y="20" text-anchor="middle">0: a</text><text class="bind" x="72" y="20" text-anchor="middle">0: b</text><text class="bind" x="120" y="20" text-anchor="middle">0: c</text><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="72" cy="0" r="3" fill="#536477"/><circle class="port" cx="120" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="72" y="-7" text-anchor="middle">1</text><text class="slot" x="120" y="-7" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(24,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #1 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #2 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n6" data-id="6" transform="translate(480,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #3 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n7" data-id="7" transform="translate(176,134)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 + +Type not computed + +[0] → — DATA +[1] → #3 DATA +[2] → #6 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n8" data-id="8" transform="translate(44,238)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 Return +Type not computed + +[0] → #2 CTRL +[1] → #7 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter03/docs/03-graph3.json b/chapter03/docs/03-graph3.json new file mode 100644 index 00000000..a6d6175a --- /dev/null +++ b/chapter03/docs/03-graph3.json @@ -0,0 +1,19 @@ +{ + "ver": 1, + "comp": "chapter03/docs/03-graph3.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 4, "role": "ASSOC", "label": "0: y0"}, {"idx": 1, "def": 3, "role": "ASSOC", "label": "0: x0"}, {"idx": 2, "def": 6, "role": "ASSOC", "label": "0: y1"}, {"idx": 3, "def": 5, "role": "ASSOC", "label": "0: x1"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 5, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "#4", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 20, "label": "#8", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter03/docs/03-graph3.svg b/chapter03/docs/03-graph3.svg index 623bd902..89eed120 100644 --- a/chapter03/docs/03-graph3.svg +++ b/chapter03/docs/03-graph3.svg @@ -1,151 +1,91 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter03 Pages: 1 --> -<svg width="554pt" height="220pt" - viewBox="0.00 0.00 554.00 220.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 216)"> -<title>chapter03</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-216 550,-216 550,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-204 386,-204 386,-8 8,-8"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="394,-8 394,-60 538,-60 538,-8 394,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="black" points="198,-196 144,-196 144,-160 198,-160 198,-196"/> -<text text-anchor="middle" x="171" y="-174.3" font-family="Times,serif" font-size="14.00">Start</text> -</g> -<!-- Con_3 --> -<g id="node2" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="black" cx="207" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-102.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Con_3->Start2 --> -<g id="edge1" class="edge"> -<title>Con_3->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M198.65,-123.24C194.46,-131.39 189.27,-141.47 184.53,-150.69"/> -<polygon fill="black" stroke="black" points="181.27,-149.38 179.81,-159.88 187.49,-152.58 181.27,-149.38"/> -<text text-anchor="middle" x="195.65" y="-125.84" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node3" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="135" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-102.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_4->Start2 --> -<g id="edge2" class="edge"> -<title>Con_4->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M143.35,-123.24C147.54,-131.39 152.73,-141.47 157.47,-150.69"/> -<polygon fill="black" stroke="black" points="154.51,-152.58 162.19,-159.88 160.73,-149.38 154.51,-152.58"/> -<text text-anchor="middle" x="140.35" y="-125.84" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_20 --> -<g id="node4" class="node"> -<title>Con_20</title> -<ellipse fill="none" stroke="black" cx="63" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-102.3" font-family="Times,serif" font-size="14.00">#8</text> -</g> -<!-- Con_20->Start2 --> -<g id="edge3" class="edge"> -<title>Con_20->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M81.81,-119.19C96.77,-128.89 118.11,-142.72 136.16,-154.42"/> -<polygon fill="black" stroke="black" points="134.42,-157.46 144.72,-159.97 138.23,-151.59 134.42,-157.46"/> -<text text-anchor="middle" x="78.81" y="-121.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_5 --> -<g id="node5" class="node"> -<title>Con_5</title> -<ellipse fill="none" stroke="black" cx="351" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="351" y="-102.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Con_5->Start2 --> -<g id="edge4" class="edge"> -<title>Con_5->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M329.82,-117.38C324.99,-119.65 319.84,-121.97 315,-124 279.07,-139.06 237.19,-154.21 207.89,-164.43"/> -<polygon fill="black" stroke="black" points="206.38,-161.25 198.08,-167.84 208.68,-167.87 206.38,-161.25"/> -<text text-anchor="middle" x="326.82" y="-119.98" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return21 --> -<g id="node6" class="node"> -<title>Return21</title> -<polygon fill="yellow" stroke="black" points="89,-52 23,-52 23,-16 89,-16 89,-52"/> -<text text-anchor="middle" x="56" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return21->Start2 --> -<g id="edge5" class="edge"> -<title>Return21->Start2</title> -<path fill="none" stroke="red" d="M42.04,-52.06C28.34,-71.02 11.57,-101.87 27,-124 50.89,-158.26 99.53,-170.43 133.64,-174.72"/> -<polygon fill="red" stroke="red" points="133.4,-178.22 143.72,-175.82 134.16,-171.26 133.4,-178.22"/> -<text text-anchor="middle" x="39.04" y="-54.66" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return21->Con_20 --> -<g id="edge6" class="edge"> -<title>Return21->Con_20</title> -<path fill="none" stroke="black" d="M57.73,-52.3C58.5,-60.02 59.43,-69.29 60.29,-77.89"/> -<polygon fill="black" stroke="black" points="56.81,-78.29 61.29,-87.9 63.78,-77.6 56.81,-78.29"/> -<text text-anchor="middle" x="54.73" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_6 --> -<g id="node7" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="279" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="279" y="-102.3" font-family="Times,serif" font-size="14.00">#4</text> -</g> -<!-- Con_6->Start2 --> -<g id="edge7" class="edge"> -<title>Con_6->Start2</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M260.19,-119.19C245.23,-128.89 223.89,-142.72 205.84,-154.42"/> -<polygon fill="black" stroke="black" points="203.77,-151.59 197.28,-159.97 207.58,-157.46 203.77,-151.59"/> -<text text-anchor="middle" x="257.19" y="-121.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Scope1_0 --> -<g id="node8" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="410,-23 410,-44 426,-44 426,-23 410,-23"/> -<polygon fill="none" stroke="black" points="410,-23 410,-44 426,-44 426,-23 410,-23"/> -<text text-anchor="start" x="413" y="-29.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="426,-23 426,-44 450,-44 450,-23 426,-23"/> -<text text-anchor="start" x="429" y="-29.8" font-family="Times,serif" font-size="14.00">y0</text> -<polygon fill="none" stroke="black" points="450,-23 450,-44 474,-44 474,-23 450,-23"/> -<text text-anchor="start" x="453" y="-29.8" font-family="Times,serif" font-size="14.00">x0</text> -<polygon fill="none" stroke="black" points="474,-23 474,-44 498,-44 498,-23 474,-23"/> -<text text-anchor="start" x="477" y="-29.8" font-family="Times,serif" font-size="14.00">y1</text> -<polygon fill="none" stroke="black" points="498,-23 498,-44 522,-44 522,-23 498,-23"/> -<text text-anchor="start" x="501" y="-29.8" font-family="Times,serif" font-size="14.00">x1</text> -</g> -<!-- Scope1_0->Con_3 --> -<g id="edge9" class="edge"> -<title>Scope1_0:Scope1_0_x0->Con_3</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M462,-45C462,-94.6 290.16,-72.65 243,-88 241.08,-88.63 239.12,-89.33 237.17,-90.09"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="235.39,-87.04 227.58,-94.19 238.15,-93.48 235.39,-87.04"/> -</g> -<!-- Scope1_0->Con_4 --> -<g id="edge8" class="edge"> -<title>Scope1_0:Scope1_0_y0->Con_4</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M438,-45C438,-67.35 411.84,-55.23 390,-60 294.13,-80.94 265.19,-60.49 171,-88 169.06,-88.57 167.09,-89.23 165.13,-89.95"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="163.39,-86.88 155.5,-93.97 166.08,-93.34 163.39,-86.88"/> -</g> -<!-- Scope1_0->Con_5 --> -<g id="edge11" class="edge"> -<title>Scope1_0:Scope1_0_x1->Con_5</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M510,-45C510,-71.13 433.9,-89.82 387,-98.86"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="386.09,-95.47 376.9,-100.75 387.37,-102.35 386.09,-95.47"/> -</g> -<!-- Scope1_0->Con_6 --> -<g id="edge10" class="edge"> -<title>Scope1_0:Scope1_0_y1->Con_6</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M486,-45C486,-123.37 388.78,-61.59 315,-88 313.15,-88.66 311.26,-89.39 309.37,-90.16"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="307.8,-87.02 300.03,-94.23 310.6,-93.44 307.8,-87.02"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1204" height="208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1204 208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M388,77 C388,101 1001.5,74 1001.5,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #4 · ASSOC · 0: y0</title></path><path class="edge ASSOC" id="e1i1" d="M236,77 C236,101 1052.5,74 1052.5,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #3 · ASSOC · 0: x0</title></path><path class="edge ASSOC" id="e1i2" d="M692,77 C692,101 1103.5,74 1103.5,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #6 · ASSOC · 0: y1</title></path><path class="edge ASSOC" id="e1i3" d="M540,77 C540,101 1154.5,74 1154.5,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[3] → #5 · ASSOC · 0: x1</title></path><path class="edge ASSOC" id="e3i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e4i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e5i0" d="M84,77 C84,101 540,3 540,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e6i0" d="M84,77 C84,101 692,3 692,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#6[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e20i0" d="M84,77 C84,101 844,3 844,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#20[0] → #2 · ASSOC</title></path><path class="edge CTRL" id="e21i0" d="M84,80 L84,128" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #2 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M844,80 L844,90 L124,90 L124,128" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #20 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(976,98)" style="opacity: 1;"><path class="box" d="M4,0H200Q204,0 204,4V52Q204,56 200,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="102" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="102"/><title>#1 Scope +Type not computed + +[0] → #4 ASSOC 0: y0 +[1] → #3 ASSOC 0: x0 +[2] → #6 ASSOC 0: y1 +[3] → #5 ASSOC 0: x1</title><line class="row" x1="0" x2="204" y1="30" y2="30"/><line class="row" x1="51" x2="51" y1="0" y2="30"/><line class="row" x1="102" x2="102" y1="0" y2="30"/><line class="row" x1="153" x2="153" y1="0" y2="30"/><text class="bind" x="25.5" y="20" text-anchor="middle">0: y0</text><text class="bind" x="76.5" y="20" text-anchor="middle">0: x0</text><text class="bind" x="127.5" y="20" text-anchor="middle">0: y1</text><text class="bind" x="178.5" y="20" text-anchor="middle">0: x1</text><circle class="port" cx="25.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="76.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="127.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="178.5" cy="0" r="3" fill="#536477"/><text class="slot" x="25.5" y="-7" text-anchor="middle">0</text><text class="slot" x="76.5" y="-7" text-anchor="middle">1</text><text class="slot" x="127.5" y="-7" text-anchor="middle">2</text><text class="slot" x="178.5" y="-7" text-anchor="middle">3</text></g><g class="node" id="n2" data-id="2" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #1 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #2 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n5" data-id="5" transform="translate(480,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 #3 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n6" data-id="6" transform="translate(632,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#4</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #4 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n20" data-id="20" transform="translate(784,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#8</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 #8 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n21" data-id="21" transform="translate(44,134)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Return +Type not computed + +[0] → #2 CTRL +[1] → #20 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter03/docs/03-graph4.json b/chapter03/docs/03-graph4.json new file mode 100644 index 00000000..b594eee2 --- /dev/null +++ b/chapter03/docs/03-graph4.json @@ -0,0 +1,17 @@ +{ + "ver": 1, + "comp": "chapter03/docs/03-graph4.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 3, "role": "ASSOC", "label": "0: a"}, {"idx": 1, "def": 4, "role": "ASSOC", "label": "0: b"}, {"idx": 2, "def": 8, "role": "ASSOC", "label": "0: c"}, {"idx": 3, "def": 6, "role": "ASSOC", "label": "1: b"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 6, "label": "#5", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 8, "label": "#6", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter03/docs/03-graph4.svg b/chapter03/docs/03-graph4.svg index 6838e1d4..c773ef9b 100644 --- a/chapter03/docs/03-graph4.svg +++ b/chapter03/docs/03-graph4.svg @@ -1,127 +1,84 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter03 Pages: 1 --> -<svg width="310pt" height="228pt" viewBox="0.00 0.00 310.00 228.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 224)"> -<title>chapter03</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-224 306,-224 306,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-88 8,-212 294,-212 294,-88 8,-88"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="#000000" points="97,-8 97,-76 259,-76 259,-8 97,-8"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="#000000" points="181,-16 181,-68 251,-68 251,-16 181,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="#ffff00" stroke="#000000" points="178,-204 124,-204 124,-168 178,-168 178,-204"/> -<text text-anchor="middle" x="151" y="-181.8" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -</g> -<!-- Con_3 --> -<g id="node2" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="#000000" cx="43" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#1</text> -</g> -<!-- Con_3->Start2 --> -<g id="edge1" class="edge"> -<title>Con_3->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M62.3082,-126.8722C77.012,-136.6747 97.6668,-150.4445 115.3448,-162.2299"/> -<polygon fill="#000000" stroke="#000000" points="113.4829,-165.195 123.7449,-167.8299 117.3658,-159.3707 113.4829,-165.195"/> -<text text-anchor="middle" x="64.5318" y="-129.2722" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_4 --> -<g id="node3" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="#000000" cx="115" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#2</text> -</g> -<!-- Con_4->Start2 --> -<g id="edge2" class="edge"> -<title>Con_4->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M123.7146,-131.4292C127.8228,-139.6456 132.8196,-149.6392 137.4089,-158.8179"/> -<polygon fill="#000000" stroke="#000000" points="134.387,-160.6004 141.9897,-167.9794 140.648,-157.4699 134.387,-160.6004"/> -<text text-anchor="middle" x="121.491" y="-133.8292" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_6 --> -<g id="node4" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="#000000" cx="259" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="259" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#5</text> -</g> -<!-- Con_6->Start2 --> -<g id="edge3" class="edge"> -<title>Con_6->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M239.6918,-126.8722C224.988,-136.6747 204.3332,-150.4445 186.6552,-162.2299"/> -<polygon fill="#000000" stroke="#000000" points="184.6342,-159.3707 178.2551,-167.8299 188.5171,-165.195 184.6342,-159.3707"/> -<text text-anchor="middle" x="237.4682" y="-129.2722" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_8 --> -<g id="node5" class="node"> -<title>Con_8</title> -<ellipse fill="none" stroke="#000000" cx="187" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="187" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#6</text> -</g> -<!-- Con_8->Start2 --> -<g id="edge4" class="edge"> -<title>Con_8->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M178.2854,-131.4292C174.1772,-139.6456 169.1804,-149.6392 164.5911,-158.8179"/> -<polygon fill="#000000" stroke="#000000" points="161.352,-157.4699 160.0103,-167.9794 167.613,-160.6004 161.352,-157.4699"/> -<text text-anchor="middle" x="176.0618" y="-133.8292" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Scope1_0 --> -<g id="node6" class="node"> -<title>Scope1_0</title> -<polygon fill="#00ffff" stroke="transparent" points="113,-31 113,-53 126,-53 126,-31 113,-31"/> -<polygon fill="none" stroke="#000000" points="113,-31 113,-53 126,-53 126,-31 113,-31"/> -<text text-anchor="start" x="116" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">0</text> -<polygon fill="none" stroke="#000000" points="126,-31 126,-53 138,-53 138,-31 126,-31"/> -<text text-anchor="start" x="128.8927" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">a</text> -<polygon fill="none" stroke="#000000" points="138,-31 138,-53 151,-53 151,-31 138,-31"/> -<text text-anchor="start" x="141" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">b</text> -<polygon fill="none" stroke="#000000" points="151,-31 151,-53 163,-53 163,-31 151,-31"/> -<text text-anchor="start" x="153.8927" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">c</text> -</g> -<!-- Scope1_0->Con_3 --> -<g id="edge5" class="edge"> -<title>Scope1_0:Scope1_0_a->Con_3</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M132,-53C132,-81.2283 102.2249,-71.955 79,-88 75.8998,-90.1418 72.6712,-92.4134 69.4762,-94.6873"/> -<polygon fill="#6495ed" stroke="#6495ed" points="67.2901,-91.9482 61.2087,-100.6239 71.373,-97.6342 67.2901,-91.9482"/> -</g> -<!-- Scope1_0->Con_4 --> -<g id="edge6" class="edge"> -<title>Scope1_0:Scope1_0_b->Con_4</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M145,-53C145,-65.7791 139.6328,-78.661 133.4388,-89.2726"/> -<polygon fill="#6495ed" stroke="#6495ed" points="130.3276,-87.6415 127.8968,-97.9538 136.2279,-91.4082 130.3276,-87.6415"/> -</g> -<!-- Scope1_0->Con_8 --> -<g id="edge7" class="edge"> -<title>Scope1_0:Scope1_0_c->Con_8</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M157,-53C157,-65.7791 162.3672,-78.661 168.5612,-89.2726"/> -<polygon fill="#6495ed" stroke="#6495ed" points="165.7721,-91.4082 174.1032,-97.9538 171.6724,-87.6415 165.7721,-91.4082"/> -</g> -<!-- Scope1_1 --> -<g id="node7" class="node"> -<title>Scope1_1</title> -<polygon fill="#00ffff" stroke="transparent" points="203,-31 203,-53 216,-53 216,-31 203,-31"/> -<polygon fill="none" stroke="#000000" points="203,-31 203,-53 216,-53 216,-31 203,-31"/> -<text text-anchor="start" x="206" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">1</text> -<polygon fill="none" stroke="#000000" points="216,-31 216,-53 229,-53 229,-31 216,-31"/> -<text text-anchor="start" x="219" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">b</text> -</g> -<!-- Scope1_1->Con_6 --> -<g id="edge8" class="edge"> -<title>Scope1_1:Scope1_1_b->Con_6</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M223,-53C223,-66.7784 229.8964,-80.1812 237.6523,-90.8977"/> -<polygon fill="#6495ed" stroke="#6495ed" points="235.0006,-93.1875 243.9413,-98.8721 240.497,-88.8528 235.0006,-93.1875"/> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="1040" height="178" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1040 178" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 848,74 848,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a</title></path><path class="edge ASSOC" id="e1i1" d="M388,77 C388,101 896,74 896,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #4 · ASSOC · 0: b</title></path><path class="edge ASSOC" id="e1i2" d="M692,77 C692,101 944,74 944,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #8 · ASSOC · 0: c</title></path><path class="edge ASSOC" id="e1i3" d="M540,77 C540,101 992,74 992,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[3] → #6 · ASSOC · 1: b</title></path><path class="edge ASSOC" id="e3i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e4i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e6i0" d="M84,77 C84,101 540,3 540,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#6[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e8i0" d="M84,77 C84,101 692,3 692,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#8[0] → #2 · ASSOC</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(824,98)" style="opacity: 1;"><path class="box" d="M4,0H188Q192,0 192,4V52Q192,56 188,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="96" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="96"/><title>#1 Scope +Type not computed + +[0] → #3 ASSOC 0: a +[1] → #4 ASSOC 0: b +[2] → #8 ASSOC 0: c +[3] → #6 ASSOC 1: b</title><line class="row" x1="0" x2="192" y1="30" y2="30"/><line class="row" x1="48" x2="48" y1="0" y2="30"/><line class="row" x1="96" x2="96" y1="0" y2="30"/><line class="row" x1="144" x2="144" y1="0" y2="30"/><text class="bind" x="24" y="20" text-anchor="middle">0: a</text><text class="bind" x="72" y="20" text-anchor="middle">0: b</text><text class="bind" x="120" y="20" text-anchor="middle">0: c</text><text class="bind" x="168" y="20" text-anchor="middle">1: b</text><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="72" cy="0" r="3" fill="#536477"/><circle class="port" cx="120" cy="0" r="3" fill="#536477"/><circle class="port" cx="168" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="72" y="-7" text-anchor="middle">1</text><text class="slot" x="120" y="-7" text-anchor="middle">2</text><text class="slot" x="168" y="-7" text-anchor="middle">3</text></g><g class="node" id="n2" data-id="2" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #1 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #2 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n6" data-id="6" transform="translate(480,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #5 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n8" data-id="8" transform="translate(632,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#6</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 #6 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter03/docs/03-graph5.json b/chapter03/docs/03-graph5.json new file mode 100644 index 00000000..476ad586 --- /dev/null +++ b/chapter03/docs/03-graph5.json @@ -0,0 +1,17 @@ +{ + "ver": 1, + "comp": "chapter03/docs/03-graph5.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 3, "role": "ASSOC", "label": "0: a"}, {"idx": 1, "def": 4, "role": "ASSOC", "label": "0: b"}, {"idx": 2, "def": 11, "role": "ASSOC", "label": "0: c"}, {"idx": 3, "def": 9, "role": "ASSOC", "label": "1: e"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 4, "label": "#2", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 9, "label": "#6", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 11, "label": "#7", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "ASSOC", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter03/docs/03-graph5.svg b/chapter03/docs/03-graph5.svg index 48e69cb7..a62d03bb 100644 --- a/chapter03/docs/03-graph5.svg +++ b/chapter03/docs/03-graph5.svg @@ -1,127 +1,84 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter03 Pages: 1 --> -<svg width="310pt" height="228pt" viewBox="0.00 0.00 310.00 228.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 224)"> -<title>chapter03</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-224 306,-224 306,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-88 8,-212 294,-212 294,-88 8,-88"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="#000000" points="97,-8 97,-76 259,-76 259,-8 97,-8"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="#000000" points="181,-16 181,-68 251,-68 251,-16 181,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="#ffff00" stroke="#000000" points="178,-204 124,-204 124,-168 178,-168 178,-204"/> -<text text-anchor="middle" x="151" y="-181.8" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -</g> -<!-- Con_3 --> -<g id="node2" class="node"> -<title>Con_3</title> -<ellipse fill="none" stroke="#000000" cx="43" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#1</text> -</g> -<!-- Con_3->Start2 --> -<g id="edge1" class="edge"> -<title>Con_3->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M62.3082,-126.8722C77.012,-136.6747 97.6668,-150.4445 115.3448,-162.2299"/> -<polygon fill="#000000" stroke="#000000" points="113.4829,-165.195 123.7449,-167.8299 117.3658,-159.3707 113.4829,-165.195"/> -<text text-anchor="middle" x="64.5318" y="-129.2722" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_4 --> -<g id="node3" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="#000000" cx="115" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#2</text> -</g> -<!-- Con_4->Start2 --> -<g id="edge2" class="edge"> -<title>Con_4->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M123.7146,-131.4292C127.8228,-139.6456 132.8196,-149.6392 137.4089,-158.8179"/> -<polygon fill="#000000" stroke="#000000" points="134.387,-160.6004 141.9897,-167.9794 140.648,-157.4699 134.387,-160.6004"/> -<text text-anchor="middle" x="121.491" y="-133.8292" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_9 --> -<g id="node4" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="#000000" cx="259" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="259" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#6</text> -</g> -<!-- Con_9->Start2 --> -<g id="edge3" class="edge"> -<title>Con_9->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M239.6918,-126.8722C224.988,-136.6747 204.3332,-150.4445 186.6552,-162.2299"/> -<polygon fill="#000000" stroke="#000000" points="184.6342,-159.3707 178.2551,-167.8299 188.5171,-165.195 184.6342,-159.3707"/> -<text text-anchor="middle" x="237.4682" y="-129.2722" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_11 --> -<g id="node5" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="#000000" cx="187" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="187" y="-109.8" font-family="Times,serif" font-size="14.00" fill="#000000">#7</text> -</g> -<!-- Con_11->Start2 --> -<g id="edge4" class="edge"> -<title>Con_11->Start2</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M178.2854,-131.4292C174.1772,-139.6456 169.1804,-149.6392 164.5911,-158.8179"/> -<polygon fill="#000000" stroke="#000000" points="161.352,-157.4699 160.0103,-167.9794 167.613,-160.6004 161.352,-157.4699"/> -<text text-anchor="middle" x="176.0618" y="-133.8292" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Scope1_0 --> -<g id="node6" class="node"> -<title>Scope1_0</title> -<polygon fill="#00ffff" stroke="transparent" points="113,-31 113,-53 126,-53 126,-31 113,-31"/> -<polygon fill="none" stroke="#000000" points="113,-31 113,-53 126,-53 126,-31 113,-31"/> -<text text-anchor="start" x="116" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">0</text> -<polygon fill="none" stroke="#000000" points="126,-31 126,-53 138,-53 138,-31 126,-31"/> -<text text-anchor="start" x="128.8927" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">a</text> -<polygon fill="none" stroke="#000000" points="138,-31 138,-53 151,-53 151,-31 138,-31"/> -<text text-anchor="start" x="141" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">b</text> -<polygon fill="none" stroke="#000000" points="151,-31 151,-53 163,-53 163,-31 151,-31"/> -<text text-anchor="start" x="153.8927" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">c</text> -</g> -<!-- Scope1_0->Con_3 --> -<g id="edge5" class="edge"> -<title>Scope1_0:Scope1_0_a->Con_3</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M132,-53C132,-81.2283 102.2249,-71.955 79,-88 75.8998,-90.1418 72.6712,-92.4134 69.4762,-94.6873"/> -<polygon fill="#6495ed" stroke="#6495ed" points="67.2901,-91.9482 61.2087,-100.6239 71.373,-97.6342 67.2901,-91.9482"/> -</g> -<!-- Scope1_0->Con_4 --> -<g id="edge6" class="edge"> -<title>Scope1_0:Scope1_0_b->Con_4</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M145,-53C145,-65.7791 139.6328,-78.661 133.4388,-89.2726"/> -<polygon fill="#6495ed" stroke="#6495ed" points="130.3276,-87.6415 127.8968,-97.9538 136.2279,-91.4082 130.3276,-87.6415"/> -</g> -<!-- Scope1_0->Con_11 --> -<g id="edge7" class="edge"> -<title>Scope1_0:Scope1_0_c->Con_11</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M157,-53C157,-65.7791 162.3672,-78.661 168.5612,-89.2726"/> -<polygon fill="#6495ed" stroke="#6495ed" points="165.7721,-91.4082 174.1032,-97.9538 171.6724,-87.6415 165.7721,-91.4082"/> -</g> -<!-- Scope1_1 --> -<g id="node7" class="node"> -<title>Scope1_1</title> -<polygon fill="#00ffff" stroke="transparent" points="204,-31 204,-53 217,-53 217,-31 204,-31"/> -<polygon fill="none" stroke="#000000" points="204,-31 204,-53 217,-53 217,-31 204,-31"/> -<text text-anchor="start" x="207" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">1</text> -<polygon fill="none" stroke="#000000" points="217,-31 217,-53 229,-53 229,-31 217,-31"/> -<text text-anchor="start" x="219.8927" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">e</text> -</g> -<!-- Scope1_1->Con_9 --> -<g id="edge8" class="edge"> -<title>Scope1_1:Scope1_1_e->Con_9</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M223,-53C223,-66.7784 229.8964,-80.1812 237.6523,-90.8977"/> -<polygon fill="#6495ed" stroke="#6495ed" points="235.0006,-93.1875 243.9413,-98.8721 240.497,-88.8528 235.0006,-93.1875"/> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="1040" height="178" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1040 178" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 848,74 848,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a</title></path><path class="edge ASSOC" id="e1i1" d="M388,77 C388,101 896,74 896,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #4 · ASSOC · 0: b</title></path><path class="edge ASSOC" id="e1i2" d="M692,77 C692,101 944,74 944,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #11 · ASSOC · 0: c</title></path><path class="edge ASSOC" id="e1i3" d="M540,77 C540,101 992,74 992,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[3] → #9 · ASSOC · 1: e</title></path><path class="edge ASSOC" id="e3i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#3[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e4i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e9i0" d="M84,77 C84,101 540,3 540,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#9[0] → #2 · ASSOC</title></path><path class="edge ASSOC" id="e11i0" d="M84,77 C84,101 692,3 692,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#11[0] → #2 · ASSOC</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(824,98)" style="opacity: 1;"><path class="box" d="M4,0H188Q192,0 192,4V52Q192,56 188,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="96" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="96"/><title>#1 Scope +Type not computed + +[0] → #3 ASSOC 0: a +[1] → #4 ASSOC 0: b +[2] → #11 ASSOC 0: c +[3] → #9 ASSOC 1: e</title><line class="row" x1="0" x2="192" y1="30" y2="30"/><line class="row" x1="48" x2="48" y1="0" y2="30"/><line class="row" x1="96" x2="96" y1="0" y2="30"/><line class="row" x1="144" x2="144" y1="0" y2="30"/><text class="bind" x="24" y="20" text-anchor="middle">0: a</text><text class="bind" x="72" y="20" text-anchor="middle">0: b</text><text class="bind" x="120" y="20" text-anchor="middle">0: c</text><text class="bind" x="168" y="20" text-anchor="middle">1: e</text><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="72" cy="0" r="3" fill="#536477"/><circle class="port" cx="120" cy="0" r="3" fill="#536477"/><circle class="port" cx="168" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="72" y="-7" text-anchor="middle">1</text><text class="slot" x="120" y="-7" text-anchor="middle">2</text><text class="slot" x="168" y="-7" text-anchor="middle">3</text></g><g class="node" id="n2" data-id="2" transform="translate(24,30)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(176,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#3 #1 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(328,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #2 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n9" data-id="9" transform="translate(480,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#6</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 #6 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n11" data-id="11" transform="translate(632,30)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#7</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #7 +Type not computed + +[0] → #2 ASSOC</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter03/docs/Makefile b/chapter03/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter03/docs/Makefile +++ b/chapter03/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter03/src/main/java/com/seaofnodes/simple/type/Type.java b/chapter03/src/main/java/com/seaofnodes/simple/type/Type.java index 7ea17bfb..b98ce6de 100644 --- a/chapter03/src/main/java/com/seaofnodes/simple/type/Type.java +++ b/chapter03/src/main/java/com/seaofnodes/simple/type/Type.java @@ -36,5 +36,10 @@ public class Type { public boolean isConstant() { return _type == TTOP; } + @Override + public String toString() { + return print(new StringBuilder()).toString(); + } + public StringBuilder print(StringBuilder sb) {return is_simple() ? sb.append(STRS[_type]) : sb;} } diff --git a/chapter04/README.md b/chapter04/README.md index fd77392c..e7ae71d2 100644 --- a/chapter04/README.md +++ b/chapter04/README.md @@ -1,26 +1,29 @@ # Chapter 4: External Argument and Comparisons +[Previous: Chapter 3](../chapter03/README.md) | +[Next: Chapter 5](../chapter05/README.md) + # Table of Contents 1. [Extensions to Intermediate Representation](#extensions-to-intermediate-representation) 2. [Projection Nodes](#projection-nodes) 3. [Visualisation](#visualisation) -5. [Initial values](#initial-values) -6. [When Is Control Not-Null?](#when-is-control-not-null) -5. [Note Regarding Visualizations](#note-regarding-visualizations) -6. [Changes to Type System](#changes-to-type-system) -7. [Tuple Types](#tuple-types) -8. [$ctrl name binding](#ctrl-name-binding) -9. [More Peephole Optimizations](#more-peephole-optimizations) -10. [Peephole Walkthrough](#peephole-walkthrough) -11. [Dead Code Elimination(DCE)](#dead-code-eliminationdce) +4. [Initial values](#initial-values) +5. [When Is Control Not-Null?](#when-is-control-not-null) +6. [Note Regarding Visualizations](#note-regarding-visualizations) +7. [Changes to Type System](#changes-to-type-system) +8. [Tuple Types](#tuple-types) +9. [$ctrl name binding](#ctrl-name-binding) +10. [More Peephole Optimizations](#more-peephole-optimizations) +11. [Peephole Walkthrough](#peephole-walkthrough) +12. [Dead Code Elimination(DCE)](#dead-code-eliminationdce) You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter04) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter03...linear-chapter04) it to the previous chapter. -In this chapter we extend the language grammar with following features: +In this chapter we extend the language grammar with the following features: -* The program receives a single argument named `arg` of integer type from external environment. +* The program receives a single argument named `arg` of integer type from the external environment. * Expressions support comparison operators. * We introduce a scope sensitive name binding `$ctrl` for the current incoming control node. Thus, our Return is no longer hard-wired to Start, instead it @@ -69,15 +72,15 @@ In the visuals, projection nodes are shown as rectangular boxes inside the node ### Visualisation - + In the visual above, the projection nodes have been tagged by the names -associated with the outputs of the Start node. Both MultiNode that contain -Control and Control nodes are yellow. `$ctrl` and `arg` are outputs(users) of +associated with the outputs of the Start node. Both MultiNodes that contain +Control and Control nodes are yellow. `$ctrl` and `arg` are outputs (users) of StartNode(`START`) and have their MultiNode as their only input in slot 0. The `label` has no semantics and is used during debug printing. -```java +```java public ProjNode(MultiNode ctrl, int idx, String label) { super(ctrl); ``` @@ -130,37 +133,37 @@ The graph: constant. The `arg` was originally defined by a ProjNode; but when peephole is called the computed type is a constant, and the ProjNode gets replaced with a ConstantNode: - + ```java public final Node peephole( ) { - Type type = _type = compute(); + Type type = _type = compute(); /* type = {TypeInteger@1527} "2" */ // ProjNode is not a constant unlike its type. if (!(this instanceof ConstantNode) && type.isConstant()) /* Create Constant(2) */ return deadCodeElim(new ConstantNode(type).peephole()); - + /* won't get called */ ... ``` If you don't pass an argument you get `TypeInteger.BOT` -```java +```java Parser parser = new Parser("return arg; "); ... - + public Parser(String source) { this(source, TypeInteger.BOT); } - + ``` We clearly see this is not a constant: ```java -public final static TypeInteger BOT = new TypeInteger(false, 1); +public final static TypeInteger BOT = new TypeInteger(false, 1); /* _is_con = false */ ``` @@ -177,7 +180,7 @@ In later chapters, `$ctrl` will point to other control nodes, such as #### Note Regarding Visualizations From this chapter onwards we omit the edges from Constants to Start node, mainly to reduce -clutter and help draw reader's attention to the more important aspects of the graph. +clutter and help draw the reader's attention to the more important aspects of the graph. @@ -195,7 +198,7 @@ associated with a Type at a specific Node can be conveniently represented as a [lattice](https://en.wikipedia.org/wiki/Lattice_(order)). The type itself is identified by the Java class `Type` and subtypes. The type -implementation uses Java classes as convenient to deal with a Types' internal +implementation uses Java classes as a convenient way to deal with a Type's internal structure - but the Java classes have no relation to a Type's place in the lattice. @@ -239,20 +242,20 @@ In the table above `Con1` and `Con2` represent two distinct integer values, and * The `meet` of any integer with itself is that integer. * The `meet` of two unrelated integer constants is `IntBot`. -Currently, all our integer valued nodes are either a constant or a `IntBot` integer type. +Currently, all our integer valued nodes are either a constant or an `IntBot` integer type. When we start optimizing loops, we will start seeing `IntTop` values. ### Tuple Types -Tuple types need a little more explaination: they are a fixed-size grouping of +Tuple types need a little more explanation: they are a fixed-size grouping of types; literally a `Type[]`. Tuples represent a collection of otherwise unrelated types, and come from `MultiNode`s. `ProjNode`s will take the appropriate `Type` array element out of a Tuple. The `StartNode` now produces a 2-element `TypeTuple` with control and the type of `arg`: `[ctrl, TypeInteger.INTBOT]` The lattice `meet` operator on Tuples is done element by element; each array -element recursively calls `meet`. Tuples of mixed sizes are a internal +element recursively calls `meet`. Tuples of mixed sizes are an internal compiler error, and the `meet` uses Bottom for them. @@ -284,7 +287,7 @@ We would expect the compiler to output `arg+3` here, but as it stands what we ge  -We need to perform some algebraic simplifications to enable better outcome. For +We need to perform some algebraic simplifications to enable a better outcome. For example, we need to rearrange the expression as follows: ``` @@ -303,7 +306,7 @@ Here is a list of peepholes introduced in this Chapter, more will be introduced |-----------------------|-----------------------|------------------------------------------------| | (arg + 0 ) | arg | Add of zero identity | | (arg - 0 ) | arg | Sub of zero identity | -| (arg * 1 ) | arg | Multiple of one identity | +| (arg * 1 ) | arg | Multiply by one identity | | (con + arg) | (arg + con) | Move constants to right, to encourage folding | | (con * arg) | (arg * con) | Move constants to right, to encourage folding | | (con1 + (arg + con2)) | (arg + (con1 + con2)) | Move constants to right, to encourage folding | @@ -374,18 +377,18 @@ public final Node peephole( ) { } ``` -The peephole method does following: +The peephole method does the following: - Compute a Type for the node. - If the Type is a Constant and the node is not a ConstantNode, replace with a ConstantNode, recursively invoking peephole on the new constant. - Otherwise, ask the Node for a better replacement via a call to `idealize()`. - The "better replacement" is things like `(1+2)` becomes `3` and `1+(x+2))` + The "better replacement" is things like `(1+2)` becomes `3` and `1+(x+2)` becomes `(x+(1+2))`. -- - Each Node subtype is responsible for deciding what the `idealize()` step +- Each Node subtype is responsible for deciding what the `idealize()` step should do. If there is a better replacement then the node returns a non `null` value. -- - If we see a non `null` value, something changed, so we invoke `peephole()` +- If we see a non `null` value, something changed, so we invoke `peephole()` again and then also run dead code elimination on the (now dead and replaced) `this` node. diff --git a/chapter04/docs/04-arg1.json b/chapter04/docs/04-arg1.json new file mode 100644 index 00000000..b16dc51b --- /dev/null +++ b/chapter04/docs/04-arg1.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-arg1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 5, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-arg1.svg b/chapter04/docs/04-arg1.svg index cf4599c5..b948e7cd 100644 --- a/chapter04/docs/04-arg1.svg +++ b/chapter04/docs/04-arg1.svg @@ -1,84 +1,81 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter04 Pages: 1 --> -<svg width="358pt" height="186pt" viewBox="0.00 0.00 358.00 186.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 182)"> -<title>chapter04</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-182 354,-182 354,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-16 8,-170 154,-170 154,-16 8,-16"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="#000000" points="162,-8 162,-76 342,-76 342,-8 162,-8"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="#000000" points="264,-16 264,-68 334,-68 334,-16 264,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="#ffff00" stroke="transparent" points="25,-132 25,-158 66,-158 66,-132 25,-132"/> -<polygon fill="none" stroke="#000000" points="25,-132 25,-158 66,-158 66,-132 25,-132"/> -<text text-anchor="start" x="32.2805" y="-140.4" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -<polygon fill="none" stroke="#000000" points="25,-100 25,-132 66,-132 66,-100 25,-100"/> -<polygon fill="#ffff00" stroke="transparent" points="30,-105 30,-127 61,-127 61,-105 30,-105"/> -<polygon fill="none" stroke="#000000" points="30,-105 30,-127 61,-127 61,-105 30,-105"/> -<text text-anchor="start" x="32.6718" y="-111.4" font-family="Times,serif" font-size="14.00" fill="#000000">$ctrl</text> -</g> -<!-- Con_5 --> -<g id="node2" class="node"> -<title>Con_5</title> -<ellipse fill="none" stroke="#000000" cx="119" cy="-129" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-124.8" font-family="Times,serif" font-size="14.00" fill="#000000">2</text> -</g> -<!-- Return6 --> -<g id="node3" class="node"> -<title>Return6</title> -<polygon fill="#ffff00" stroke="#000000" points="109.1025,-60 54.8975,-60 54.8975,-24 109.1025,-24 109.1025,-60"/> -<text text-anchor="middle" x="82" y="-37.8" font-family="Times,serif" font-size="14.00" fill="#000000">Return</text> -</g> -<!-- Return6->Start2 --> -<g id="edge1" class="edge"> -<title>Return6->Start2:p0</title> -<path fill="none" stroke="#ff0000" d="M65.0542,-60.052C57.6135,-69.4899 49.9318,-81.7894 47.1181,-94.8747"/> -<polygon fill="#ff0000" stroke="#ff0000" points="43.6189,-94.6762 46,-105 50.5766,-95.4446 43.6189,-94.6762"/> -<text text-anchor="middle" x="62.8306" y="-62.452" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return6->Con_5 --> -<g id="edge2" class="edge"> -<title>Return6->Con_5</title> -<path fill="none" stroke="#000000" d="M89.6664,-60.0265C94.8444,-72.2017 101.7707,-88.4878 107.5926,-102.1772"/> -<polygon fill="#000000" stroke="#000000" points="104.4613,-103.7577 111.5959,-111.5903 110.903,-101.0181 104.4613,-103.7577"/> -<text text-anchor="middle" x="87.4428" y="-62.4265" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Scope1_0 --> -<g id="node4" class="node"> -<title>Scope1_0</title> -<polygon fill="#00ffff" stroke="transparent" points="179,-31 179,-53 192,-53 192,-31 179,-31"/> -<polygon fill="none" stroke="#000000" points="179,-31 179,-53 192,-53 192,-31 179,-31"/> -<text text-anchor="start" x="182" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">0</text> -<polygon fill="none" stroke="#000000" points="192,-31 192,-53 223,-53 223,-31 192,-31"/> -<text text-anchor="start" x="194.6718" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">$ctrl</text> -<polygon fill="none" stroke="#000000" points="223,-31 223,-53 246,-53 246,-31 223,-31"/> -<text text-anchor="start" x="225.5624" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">arg</text> -</g> -<!-- Scope1_0->Con_5 --> -<g id="edge3" class="edge"> -<title>Scope1_0:Scope1_0_arg->Con_5</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M235,-53C235,-91.8959 188.8038,-111.9666 154.717,-121.4819"/> -<polygon fill="#6495ed" stroke="#6495ed" points="153.8305,-118.0959 145.0327,-123.9992 155.5916,-124.8708 153.8305,-118.0959"/> -</g> -<!-- Scope1_1 --> -<g id="node5" class="node"> -<title>Scope1_1</title> -<polygon fill="#00ffff" stroke="transparent" points="293,-31 293,-53 306,-53 306,-31 293,-31"/> -<polygon fill="none" stroke="#000000" points="293,-31 293,-53 306,-53 306,-31 293,-31"/> -<text text-anchor="start" x="296" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">1</text> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="518" height="246" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 518 246" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M242,115 C242,139 465.5,0 465.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg</title></path><path class="edge CTRL" id="e6i0" d="M84,118 L84,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[0] → #4 · CTRL</title></path><path class="edge DATA" id="e6i1" d="M242,118 L242,128 L124,128 L124,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#6[1] → #5 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(374,24)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #5 ASSOC 0: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">0: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="white"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(182,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>2</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 2 +Type not computed + +</title></g><g class="node" id="n6" data-id="6" transform="translate(44,172)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Return +Type not computed + +[0] → #4 CTRL +[1] → #5 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter04/docs/04-arg2.json b/chapter04/docs/04-arg2.json new file mode 100644 index 00000000..5d2d7fde --- /dev/null +++ b/chapter04/docs/04-arg2.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-arg2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 6, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 6, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-arg2.svg b/chapter04/docs/04-arg2.svg index 2b3b47a3..aebd8b0d 100644 --- a/chapter04/docs/04-arg2.svg +++ b/chapter04/docs/04-arg2.svg @@ -1,80 +1,82 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter04 Pages: 1 --> -<svg width="308pt" height="186pt" viewBox="0.00 0.00 308.00 186.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 182)"> -<title>chapter04</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-182 304,-182 304,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-16 8,-170 104,-170 104,-16 8,-16"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="#000000" points="112,-8 112,-76 292,-76 292,-8 112,-8"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="#000000" points="214,-16 214,-68 284,-68 284,-16 214,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="#ffff00" stroke="transparent" points="24,-132 24,-158 88,-158 88,-132 24,-132"/> -<polygon fill="none" stroke="#000000" points="24,-132 24,-158 88,-158 88,-132 24,-132"/> -<text text-anchor="start" x="42.7805" y="-140.4" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -<polygon fill="none" stroke="#000000" points="24,-100 24,-132 88,-132 88,-100 24,-100"/> -<polygon fill="#ffff00" stroke="transparent" points="29,-105 29,-127 60,-127 60,-105 29,-105"/> -<polygon fill="none" stroke="#000000" points="29,-105 29,-127 60,-127 60,-105 29,-105"/> -<text text-anchor="start" x="31.6718" y="-111.4" font-family="Times,serif" font-size="14.00" fill="#000000">$ctrl</text> -<polygon fill="none" stroke="#000000" points="60,-105 60,-127 83,-127 83,-105 60,-105"/> -<text text-anchor="start" x="62.5624" y="-111.4" font-family="Times,serif" font-size="14.00" fill="#000000">arg</text> -</g> -<!-- Return5 --> -<g id="node2" class="node"> -<title>Return5</title> -<polygon fill="#ffff00" stroke="#000000" points="83.1025,-60 28.8975,-60 28.8975,-24 83.1025,-24 83.1025,-60"/> -<text text-anchor="middle" x="56" y="-37.8" font-family="Times,serif" font-size="14.00" fill="#000000">Return</text> -</g> -<!-- Return5->Start2 --> -<g id="edge1" class="edge"> -<title>Return5->Start2:p0</title> -<path fill="none" stroke="#ff0000" d="M50.7017,-60.0225C48.1903,-69.7926 45.5126,-82.3709 44.4612,-94.733"/> -<polygon fill="#ff0000" stroke="#ff0000" points="40.9524,-94.853 44,-105 47.9454,-95.1672 40.9524,-94.853"/> -<text text-anchor="middle" x="48.4781" y="-62.4225" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return5->Start2 --> -<g id="edge2" class="edge"> -<title>Return5->Start2:p1</title> -<path fill="none" stroke="#000000" d="M63.1576,-60.1614C66.4858,-69.8668 70.0107,-82.3387 71.3935,-94.7027"/> -<polygon fill="#000000" stroke="#000000" points="67.918,-95.2231 72,-105 74.9059,-94.8115 67.918,-95.2231"/> -<text text-anchor="middle" x="60.934" y="-62.5614" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Scope1_0 --> -<g id="node3" class="node"> -<title>Scope1_0</title> -<polygon fill="#00ffff" stroke="transparent" points="129,-31 129,-53 142,-53 142,-31 129,-31"/> -<polygon fill="none" stroke="#000000" points="129,-31 129,-53 142,-53 142,-31 129,-31"/> -<text text-anchor="start" x="132" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">0</text> -<polygon fill="none" stroke="#000000" points="142,-31 142,-53 173,-53 173,-31 142,-31"/> -<text text-anchor="start" x="144.6718" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">$ctrl</text> -<polygon fill="none" stroke="#000000" points="173,-31 173,-53 196,-53 196,-31 173,-31"/> -<text text-anchor="start" x="175.5624" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">arg</text> -</g> -<!-- Scope1_0->Start2 --> -<g id="edge3" class="edge"> -<title>Scope1_0:Scope1_0_arg->Start2:p1</title> -<path fill="none" stroke="#6495ed" stroke-dasharray="5,2" d="M185,-53C185,-102.849 142.3608,-114.5665 93.2341,-115.8698"/> -<polygon fill="#6495ed" stroke="#6495ed" points="92.9546,-112.373 83,-116 93.0437,-119.3724 92.9546,-112.373"/> -</g> -<!-- Scope1_1 --> -<g id="node4" class="node"> -<title>Scope1_1</title> -<polygon fill="#00ffff" stroke="transparent" points="243,-31 243,-53 256,-53 256,-31 243,-31"/> -<polygon fill="none" stroke="#000000" points="243,-31 243,-53 256,-53 256,-31 243,-31"/> -<text text-anchor="start" x="246" y="-37.4" font-family="Times,serif" font-size="14.00" fill="#000000">1</text> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="486" height="246" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 486 246" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 433.5,0 433.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #6 · ASSOC · 0: arg</title></path><path class="edge CTRL" id="e5i0" d="M84,118 L84,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#5[0] → #4 · CTRL</title></path><path class="edge DATA" id="e5i1" d="M204,118 L204,128 L124,128 L124,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#5[1] → #6 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(342,24)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #6 ASSOC 0: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">0: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="white"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(44,172)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 Return +Type not computed + +[0] → #4 CTRL +[1] → #6 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n6" data-id="6" transform="translate(144,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter04/docs/04-post-peephole.json b/chapter04/docs/04-post-peephole.json new file mode 100644 index 00000000..4890ca67 --- /dev/null +++ b/chapter04/docs/04-post-peephole.json @@ -0,0 +1,18 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-post-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 5, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 10, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 11, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-post-peephole.svg b/chapter04/docs/04-post-peephole.svg index 550c16ef..530155dd 100644 --- a/chapter04/docs/04-post-peephole.svg +++ b/chapter04/docs/04-post-peephole.svg @@ -1,108 +1,90 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter04 Pages: 1 --> -<svg width="417pt" height="248pt" - viewBox="0.00 0.00 417.00 248.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 244)"> -<title>chapter04</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-244 413,-244 413,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-232 193,-232 193,-8 8,-8"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="201,-72 201,-140 401,-140 401,-72 201,-72"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="323,-80 323,-132 393,-132 393,-80 323,-80"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="97,-195 97,-220 178,-220 178,-195 97,-195"/> -<polygon fill="none" stroke="black" points="97,-195 97,-220 178,-220 178,-195 97,-195"/> -<text text-anchor="start" x="119" y="-203.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="97,-164 97,-195 178,-195 178,-164 97,-164"/> -<polygon fill="yellow" stroke="transparent" points="102,-169 102,-190 142,-190 142,-169 102,-169"/> -<polygon fill="none" stroke="black" points="102,-169 102,-190 142,-190 142,-169 102,-169"/> -<text text-anchor="start" x="105" y="-175.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="142,-169 142,-190 173,-190 173,-169 142,-169"/> -<text text-anchor="start" x="145" y="-175.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Con_10 --> -<g id="node2" class="node"> -<title>Con_10</title> -<ellipse fill="none" stroke="black" cx="43" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-188.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Add11 --> -<g id="node3" class="node"> -<title>Add11</title> -<ellipse fill="none" stroke="black" cx="158" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="158" y="-102.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add11->Start2 --> -<g id="edge1" class="edge"> -<title>Add11->Start2:p1</title> -<path fill="none" stroke="black" d="M158,-124.09C158,-133.55 158,-145.77 158,-157.69"/> -<polygon fill="black" stroke="black" points="154.5,-158 158,-168 161.5,-158 154.5,-158"/> -<text text-anchor="middle" x="155" y="-126.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add11->Con_10 --> -<g id="edge2" class="edge"> -<title>Add11->Con_10</title> -<path fill="none" stroke="black" d="M139.03,-119.12C123,-129.54 99.59,-145.19 80,-160 75.68,-163.26 71.19,-166.85 66.88,-170.4"/> -<polygon fill="black" stroke="black" points="64.34,-167.96 58.92,-177.06 68.84,-173.32 64.34,-167.96"/> -<text text-anchor="middle" x="136.03" y="-121.72" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return12 --> -<g id="node4" class="node"> -<title>Return12</title> -<polygon fill="yellow" stroke="black" points="165,-52 99,-52 99,-16 165,-16 165,-52"/> -<text text-anchor="middle" x="132" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return12->Start2 --> -<g id="edge3" class="edge"> -<title>Return12->Start2:p0</title> -<path fill="none" stroke="red" d="M126.36,-52.13C124.59,-58.32 122.88,-65.4 122,-72 116.87,-110.66 121.12,-123.21 121.89,-157.66"/> -<polygon fill="red" stroke="red" points="118.39,-158.04 122,-168 125.39,-157.96 118.39,-158.04"/> -<text text-anchor="middle" x="123.36" y="-54.73" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return12->Add11 --> -<g id="edge4" class="edge"> -<title>Return12->Add11</title> -<path fill="none" stroke="black" d="M138.43,-52.3C141.4,-60.3 144.99,-69.98 148.29,-78.85"/> -<polygon fill="black" stroke="black" points="145.06,-80.22 151.83,-88.38 151.63,-77.78 145.06,-80.22"/> -<text text-anchor="middle" x="135.43" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Scope1_0 --> -<g id="node5" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="218,-95 218,-116 234,-116 234,-95 218,-95"/> -<polygon fill="none" stroke="black" points="218,-95 218,-116 234,-116 234,-95 218,-95"/> -<text text-anchor="start" x="221" y="-101.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="234,-95 234,-116 274,-116 274,-95 234,-95"/> -<text text-anchor="start" x="237" y="-101.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="274,-95 274,-116 305,-116 305,-95 274,-95"/> -<text text-anchor="start" x="277" y="-101.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope1_0->Start2 --> -<g id="edge5" class="edge"> -<title>Scope1_0:Scope1_0_arg->Start2:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M290,-117C290,-172.03 239,-178.4 184.25,-178.95"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="183.98,-175.45 174,-179 184.02,-182.45 183.98,-175.45"/> -</g> -<!-- Scope1_1 --> -<g id="node6" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="350,-95 350,-116 366,-116 366,-95 350,-95"/> -<polygon fill="none" stroke="black" points="350,-95 350,-116 366,-116 366,-95 350,-95"/> -<text text-anchor="start" x="353" y="-101.8" font-family="Times,serif" font-size="14.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="638" height="350" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 638 350" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 585.5,0 585.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg</title></path><path class="edge DATA" id="e11i1" d="M204,118 L204,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #5 · DATA</title></path><path class="edge DATA" id="e11i2" d="M362,118 L362,128 L234,128 L234,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[2] → #10 · DATA</title></path><path class="edge CTRL" id="e12i0" d="M84,118 L84,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #4 · CTRL</title></path><path class="edge DATA" id="e12i1" d="M204,222 L204,232 L124,232 L124,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #11 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(494,24)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #5 ASSOC 0: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">0: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="white"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(144,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #5/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n10" data-id="10" transform="translate(302,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 #3 +Type not computed + +</title></g><g class="node" id="n11" data-id="11" transform="translate(144,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #10 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(44,276)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 Return +Type not computed + +[0] → #4 CTRL +[1] → #11 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter04/docs/04-pre-peephole.json b/chapter04/docs/04-pre-peephole.json new file mode 100644 index 00000000..839c16e7 --- /dev/null +++ b/chapter04/docs/04-pre-peephole.json @@ -0,0 +1,20 @@ +{ + "ver": 1, + "comp": "chapter04/docs/04-pre-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 10, "role": "ASSOC", "label": "0: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 6, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/04-pre-peephole.svg b/chapter04/docs/04-pre-peephole.svg index 9ec38d27..5ad17b13 100644 --- a/chapter04/docs/04-pre-peephole.svg +++ b/chapter04/docs/04-pre-peephole.svg @@ -1,134 +1,98 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter04 Pages: 1 --> -<svg width="417pt" height="320pt" - viewBox="0.00 0.00 417.00 320.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 316)"> -<title>chapter04</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-316 413,-316 413,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-304 193,-304 193,-8 8,-8"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="201,-144 201,-212 401,-212 401,-144 201,-144"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="323,-152 323,-204 393,-204 393,-152 323,-152"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="97,-267 97,-292 178,-292 178,-267 97,-267"/> -<polygon fill="none" stroke="black" points="97,-267 97,-292 178,-292 178,-267 97,-267"/> -<text text-anchor="start" x="119" y="-275.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="97,-236 97,-267 178,-267 178,-236 97,-236"/> -<polygon fill="yellow" stroke="transparent" points="102,-241 102,-262 142,-262 142,-241 102,-241"/> -<polygon fill="none" stroke="black" points="102,-241 102,-262 142,-262 142,-241 102,-241"/> -<text text-anchor="start" x="105" y="-247.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="142,-241 142,-262 173,-262 173,-241 142,-241"/> -<text text-anchor="start" x="145" y="-247.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Con_5 --> -<g id="node2" class="node"> -<title>Con_5</title> -<ellipse fill="none" stroke="black" cx="115" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-174.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="43" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-260.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Add7 --> -<g id="node4" class="node"> -<title>Add7</title> -<ellipse fill="none" stroke="black" cx="43" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-174.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add7->Start2 --> -<g id="edge1" class="edge"> -<title>Add7->Start2:p1</title> -<path fill="none" stroke="black" d="M56.63,-193.93C62.95,-200.18 70.86,-207.11 79,-212 107.43,-229.09 147.88,-208.4 156.39,-229.99"/> -<polygon fill="black" stroke="black" points="152.96,-230.68 158,-240 159.87,-229.57 152.96,-230.68"/> -<text text-anchor="middle" x="53.63" y="-196.53" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add7->Con_6 --> -<g id="edge2" class="edge"> -<title>Add7->Con_6</title> -<path fill="none" stroke="black" d="M43,-196.4C43,-207.74 43,-222.77 43,-235.68"/> -<polygon fill="black" stroke="black" points="39.5,-235.9 43,-245.9 46.5,-235.9 39.5,-235.9"/> -<text text-anchor="middle" x="40" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add8 --> -<g id="node5" class="node"> -<title>Add8</title> -<ellipse fill="none" stroke="black" cx="115" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-102.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add8->Con_5 --> -<g id="edge3" class="edge"> -<title>Add8->Con_5</title> -<path fill="none" stroke="black" d="M115,-124.3C115,-132.02 115,-141.29 115,-149.89"/> -<polygon fill="black" stroke="black" points="111.5,-149.9 115,-159.9 118.5,-149.9 111.5,-149.9"/> -<text text-anchor="middle" x="112" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add8->Add7 --> -<g id="edge4" class="edge"> -<title>Add8->Add7</title> -<path fill="none" stroke="black" d="M100.43,-121.17C90.25,-131.06 76.48,-144.45 64.97,-155.64"/> -<polygon fill="black" stroke="black" points="62.53,-153.13 57.8,-162.62 67.41,-158.15 62.53,-153.13"/> -<text text-anchor="middle" x="97.43" y="-123.77" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return9 --> -<g id="node6" class="node"> -<title>Return9</title> -<polygon fill="yellow" stroke="black" points="166,-52 100,-52 100,-16 166,-16 166,-52"/> -<text text-anchor="middle" x="133" y="-30.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Return9->Start2 --> -<g id="edge5" class="edge"> -<title>Return9->Start2:p0</title> -<path fill="none" stroke="red" d="M140.48,-52.3C144.47,-62.48 148.97,-75.73 151,-88 159.98,-142.37 172.54,-161.27 151,-212 145.75,-224.37 132.06,-223.86 125.55,-230.39"/> -<polygon fill="red" stroke="red" points="122.18,-229.41 122,-240 128.74,-231.83 122.18,-229.41"/> -<text text-anchor="middle" x="137.48" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return9->Add8 --> -<g id="edge6" class="edge"> -<title>Return9->Add8</title> -<path fill="none" stroke="black" d="M128.55,-52.3C126.55,-60.1 124.13,-69.49 121.9,-78.17"/> -<polygon fill="black" stroke="black" points="118.5,-77.34 119.4,-87.9 125.28,-79.08 118.5,-77.34"/> -<text text-anchor="middle" x="125.55" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Scope1_0 --> -<g id="node7" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="218,-167 218,-188 234,-188 234,-167 218,-167"/> -<polygon fill="none" stroke="black" points="218,-167 218,-188 234,-188 234,-167 218,-167"/> -<text text-anchor="start" x="221" y="-173.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="234,-167 234,-188 274,-188 274,-167 234,-167"/> -<text text-anchor="start" x="237" y="-173.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="274,-167 274,-188 305,-188 305,-167 274,-167"/> -<text text-anchor="start" x="277" y="-173.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope1_0->Start2 --> -<g id="edge7" class="edge"> -<title>Scope1_0:Scope1_0_arg->Start2:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M290,-189C290,-244.03 239,-250.4 184.25,-250.95"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="183.98,-247.45 174,-251 184.02,-254.45 183.98,-247.45"/> -</g> -<!-- Scope1_1 --> -<g id="node8" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="350,-167 350,-188 366,-188 366,-167 350,-167"/> -<polygon fill="none" stroke="black" points="350,-167 350,-188 366,-188 366,-167 350,-167"/> -<text text-anchor="start" x="353" y="-173.8" font-family="Times,serif" font-size="14.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="638" height="454" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 638 454" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 585.5,0 585.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #10 · ASSOC · 0: arg</title></path><path class="edge DATA" id="e7i1" d="M204,118 L204,128 L307,128 L307,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #10 · DATA</title></path><path class="edge DATA" id="e7i2" d="M362,118 L362,128 L337,128 L337,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[2] → #6 · DATA</title></path><path class="edge DATA" id="e8i1" d="M155,222 L155,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #5 · DATA</title></path><path class="edge DATA" id="e8i2" d="M307,222 L307,232 L185,232 L185,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge CTRL" id="e9i0" d="M84,118 L84,374" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #4 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M155,326 L155,336 L124,336 L124,374" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #8 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(494,24)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #10 ASSOC 0: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">0: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="white"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(95,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 #1 +Type not computed + +</title></g><g class="node" id="n6" data-id="6" transform="translate(302,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #2 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(247,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 + +Type not computed + +[0] → — DATA +[1] → #10 DATA +[2] → #6 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n8" data-id="8" transform="translate(95,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(44,380)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 Return +Type not computed + +[0] → #4 CTRL +[1] → #8 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n10" data-id="10" transform="translate(144,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter04/docs/Makefile b/chapter04/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter04/docs/Makefile +++ b/chapter04/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter04/docs/projnode.json b/chapter04/docs/projnode.json new file mode 100644 index 00000000..3d4d20cf --- /dev/null +++ b/chapter04/docs/projnode.json @@ -0,0 +1,14 @@ +{ + "ver": 1, + "comp": "chapter04/docs/projnode.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}} + ], + "groups": [ + ] +} diff --git a/chapter04/docs/projnode.svg b/chapter04/docs/projnode.svg new file mode 100644 index 00000000..b1291cdb --- /dev/null +++ b/chapter04/docs/projnode.svg @@ -0,0 +1,74 @@ +<svg aria-label="Compiler graph" width="294" height="142" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 294 142" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"/><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(144,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter04/src/main/java/com/seaofnodes/simple/type/Type.java b/chapter04/src/main/java/com/seaofnodes/simple/type/Type.java index 1e50bdda..466fb739 100644 --- a/chapter04/src/main/java/com/seaofnodes/simple/type/Type.java +++ b/chapter04/src/main/java/com/seaofnodes/simple/type/Type.java @@ -41,12 +41,13 @@ public class Type { public boolean isConstant() { return _type == TTOP; } - public StringBuilder print(StringBuilder sb) {return is_simple() ? sb.append(STRS[_type]) : sb;} - - public Type meet(Type other) { return Type.BOTTOM; } - @Override public final String toString() { return print(new StringBuilder()).toString(); } + + public StringBuilder print(StringBuilder sb) {return is_simple() ? sb.append(STRS[_type]) : sb;} + + public Type meet(Type other) { return Type.BOTTOM; } + } diff --git a/chapter05/README.md b/chapter05/README.md index 2732066e..f7ff382c 100644 --- a/chapter05/README.md +++ b/chapter05/README.md @@ -1,11 +1,14 @@ # Chapter 5: If Statement, Phi, and Region +[Previous: Chapter 4](../chapter04/README.md) | +[Next: Chapter 6](../chapter06/README.md) + # Table of Contents 1. [Recap](#recap) 2. [New Nodes](#new-nodes) 3. [`IfNode`](#ifnode) -4. [`PhiNode` ](#phinode) +4. [`PhiNode`](#phinode) 5. [`RegionNode`](#regionnode) 6. [Pinned data nodes](#we-do-not-associate-a-control-edge-on-every-data-node-in-the-graph) 7. [`Stop` Nodes](#stop-nodes) @@ -19,9 +22,7 @@ 15. [Finally](#finally) 16. [Example 2](#example-2) 17. [Example 3](#example-3) -18. [Example 3](#example-3) -19. [More Examples](#more-examples) - +18. [More Examples](#more-examples) You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter05) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter04...linear-chapter05) it to the previous chapter. @@ -50,7 +51,7 @@ Here is a recap of the nodes introduced in previous chapters: | Sub | Data | 2 | Subtract a value from another | Two data nodes, the first one is subtracted by the second one | Result of the subtraction | | Mul | Data | 2 | Multiply two values | Two data nodes without restrictions on the order | Result of the multiplication | | Div | Data | 2 | Divide a value by another | Two data nodes, the first one is divided by the second one | Result of the division | -| Minus | Data | 2 | Negate a value | One data node which value is negated | Result of the negation | +| Minus | Data | 2 | Negate a value | One data node that value is negated | Result of the negation | | Scope | Symbol Table | 3 | Represents scopes in the graph | Nodes that represent the current value of variables | None | > A `Proj` is a control node when it projects a control slot: `Proj#0` off `Start`, @@ -92,7 +93,7 @@ Integer arithmetic likewise retains an integer result type when it cannot fold. In this Sea of Nodes, there is an embedded Control Flow Graph - and like a normal CFG there are merge points where two basic blocks flow into one. The `Region` node takes control from each predecessor control (block) as input and -produces a merged control as an output.[^2] +produces a merged control as an output.[^2] Both `Return` and `If` take control in slot 0. `PhiNode`s need their corresponding `RegionNode` to know when to merge data values, so again slot 0 @@ -125,7 +126,7 @@ When we parse an `if` statement, the control flow splits at that point. We must track the names being updated in each part of the `if` statement, and then merge them at the end. The implementation follows the description in *Combining Analyses, Combining Optimizations*[^4]. -This involves following: +This involves the following: 1. We create an `IfNode` with the current control token, i.e. the node mapped to `$ctrl`, and the `if` predicate expression as inputs. @@ -154,7 +155,7 @@ Implementation is in [`parseIf` method in `Parser`](https://github.com/SeaOfNode ## Operations on ScopeNodes As explained above, we duplicate ScopeNodes and merge them at a later point. There are some -subtleties in how this is implemented that is worth going over. +subtleties in how this is implemented that are worth going over. ### Duplicating a ScopeNode @@ -175,7 +176,7 @@ At the merge point we merge two ScopeNodes. The goals are: 2) A new Region node is created representing the merged control flow. The phis have this region node as the first input. 3) After the merge is completed, the duplicate is discarded, and its use of each of the nodes is also deleted. -The merging logic takes advantage of that fact that the two ScopeNodes have the bound nodes in the same order in the list of inputs. This was ensured during duplicating the ScopeNode. +The merging logic takes advantage of the fact that the two ScopeNodes have the bound nodes in the same order in the list of inputs. This was ensured during duplicating the ScopeNode. Although only the innermost occurrence of a name can have its binding changed, we scan all the nodes in our input list, and simply ignore ones where the binding has not changed. For implementation [see `ScopeNode.mergeScopes()`](https://github.com/SeaOfNodes/Simple/blob/main/chapter05/src/main/java/com/seaofnodes/simple/node/ScopeNode.java#L164-L173) @@ -195,7 +196,7 @@ return a; ### Before Merging -Following shows the graph just before we merge the two branches of the `if` statement in a `Region` node. +The following shows the graph just before we merge the two branches of the `if` statement in a `Region` node.  @@ -225,7 +226,7 @@ Here is the graph after the `return` statement was parsed and processed. ## Example #2 Consider the following code snippet: -```java +```java int b = 0; int c = 0; if (arg == 1) { @@ -241,16 +242,16 @@ return b; The value of `b` depends on which path the control flow took. To resolve this, a Φ (Phi) function is inserted. -``` +``` b = Phi(Region,2, 1); // values vary -c = Phi(Region,1, 0); // valuse vary, but dead +c = Phi(Region,1, 0); // values vary, but dead ``` The `Phi` for `c` will die when the scope where `c` is defined dies. This does not happen when merging but after the `return`. `return` is using `b` so `b` stays alive. -Before, we go ahead and parse down the if statement we duplicate the scope: +Before we go ahead and parse down the if statement we duplicate the scope: ```java ScopeNode fScope = _scope.dup(); /* Scope[$ctrl:$ctrl, arg:arg][b:0, c:0]*/ @@ -270,7 +271,7 @@ Notice, this branch modified and set a new value for both symbols currently exis Now, we set the scope back to where we started (without the modifications that `ifT` made) ```java -_scope = fScope; +_scope = fScope; ``` We then will proceed and parse down the second branch of the if statement: @@ -278,12 +279,12 @@ We then will proceed and parse down the second branch of the if statement: if (matchx("else")) { parseStatement(); fScope = _scope; - + /* Scope[$ctrl:False, arg:arg][b:1, c:0]*/ } ``` -This branch modified the values of `b` and `c`. Since the branch arms are also +The two branches modified `b`; only the true branch modified `c`. Since the branch arms are also lexical scopes, they cannot introduce new symbols in the current (outer) scope. This means that the order of the name bindings stayed the same. Excluding the first control node, we loop through and compare the nodes corresponding to the @@ -303,7 +304,7 @@ representing this conflict: ## Example #3 -Phi's implement a peephole illustrated in the example: +Phis implement a peephole illustrated in the example: ```java int a=arg==2; diff --git a/chapter05/docs/05-graph1.json b/chapter05/docs/05-graph1.json new file mode 100644 index 00000000..a2b4a7bd --- /dev/null +++ b/chapter05/docs/05-graph1.json @@ -0,0 +1,25 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 10, "role": "ASSOC", "label": "0: arg"}, {"idx": 2, "def": 14, "role": "ASSOC", "label": "1: a"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 12, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 10, "role": "ASSOC", "label": "0: arg"}, {"idx": 2, "def": 16, "role": "ASSOC", "label": "1: a"}], "proj": null}, + {"id": 6, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 7, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 11, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 0}}, + {"id": 12, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 1}}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter05/docs/05-graph1.svg b/chapter05/docs/05-graph1.svg index efe0a0e8..97813974 100644 --- a/chapter05/docs/05-graph1.svg +++ b/chapter05/docs/05-graph1.svg @@ -1,228 +1,120 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="432pt" height="356pt" - viewBox="0.00 0.00 432.00 356.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 352)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-352 428,-352 428,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="85,-88 85,-340 415,-340 415,-88 85,-88"/> -</g> -<g id="clust2" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="8,-8 8,-76 208,-76 208,-8 8,-8"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="16,-16 16,-68 86,-68 86,-16 16,-16"/> -</g> -<g id="clust4" class="cluster"> -<title>cluster_Scope12_0</title> -<polygon fill="none" stroke="black" points="216,-8 216,-76 416,-76 416,-8 216,-8"/> -</g> -<g id="clust5" class="cluster"> -<title>cluster_Scope12_1</title> -<polygon fill="none" stroke="black" points="224,-16 224,-68 294,-68 294,-16 224,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="174,-303 174,-328 255,-328 255,-303 174,-303"/> -<polygon fill="none" stroke="black" points="174,-303 174,-328 255,-328 255,-303 174,-303"/> -<text text-anchor="start" x="196" y="-311.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="174,-272 174,-303 255,-303 255,-272 174,-272"/> -<polygon fill="yellow" stroke="transparent" points="179,-277 179,-298 219,-298 219,-277 179,-277"/> -<polygon fill="none" stroke="black" points="179,-277 179,-298 219,-298 219,-277 179,-277"/> -<text text-anchor="start" x="182" y="-283.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="219,-277 219,-298 250,-298 250,-277 219,-277"/> -<text text-anchor="start" x="222" y="-283.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Con_7 --> -<g id="node2" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="308" cy="-300" rx="27" ry="18"/> -<text text-anchor="middle" x="308" y="-296.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode8 --> -<g id="node3" class="node"> -<title>EQNode8</title> -<ellipse fill="none" stroke="black" cx="245" cy="-214" rx="27" ry="18"/> -<text text-anchor="middle" x="245" y="-210.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode8->Start2 --> -<g id="edge1" class="edge"> -<title>EQNode8->Start2:p1</title> -<path fill="none" stroke="black" d="M240.7,-231.97C238.58,-241.48 236.3,-253.83 235.4,-265.95"/> -<polygon fill="black" stroke="black" points="231.9,-265.87 235,-276 238.89,-266.15 231.9,-265.87"/> -<text text-anchor="middle" x="237.7" y="-234.57" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode8->Con_7 --> -<g id="edge2" class="edge"> -<title>EQNode8->Con_7</title> -<path fill="none" stroke="black" d="M256.56,-230.41C266.06,-243.08 279.67,-261.23 290.51,-275.68"/> -<polygon fill="black" stroke="black" points="287.72,-277.79 296.52,-283.69 293.32,-273.59 287.72,-277.79"/> -<text text-anchor="middle" x="253.56" y="-233.01" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If9 --> -<g id="node4" class="node"> -<title>If9</title> -<polygon fill="yellow" stroke="transparent" points="169,-131 169,-156 263,-156 263,-131 169,-131"/> -<polygon fill="none" stroke="black" points="169,-131 169,-156 263,-156 263,-131 169,-131"/> -<text text-anchor="start" x="210.5" y="-139.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="169,-100 169,-131 263,-131 263,-100 169,-100"/> -<polygon fill="yellow" stroke="transparent" points="174,-105 174,-126 214,-126 214,-105 174,-105"/> -<polygon fill="none" stroke="black" points="174,-105 174,-126 214,-126 214,-105 174,-105"/> -<text text-anchor="start" x="177" y="-111.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="214,-105 214,-126 258,-126 258,-105 214,-105"/> -<polygon fill="none" stroke="black" points="214,-105 214,-126 258,-126 258,-105 214,-105"/> -<text text-anchor="start" x="217" y="-111.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If9->Start2 --> -<g id="edge3" class="edge"> -<title>If9->Start2:p0</title> -<path fill="none" stroke="red" d="M210.29,-160.14C205.78,-187.26 200.08,-228.01 199.14,-265.52"/> -<polygon fill="red" stroke="red" points="195.63,-265.96 199,-276 202.63,-266.05 195.63,-265.96"/> -<text text-anchor="middle" x="207.29" y="-162.74" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If9->EQNode8 --> -<g id="edge4" class="edge"> -<title>If9->EQNode8</title> -<path fill="none" stroke="black" d="M226.8,-160.28C229.78,-168.9 232.97,-178.17 235.85,-186.49"/> -<polygon fill="black" stroke="black" points="232.58,-187.76 239.16,-196.07 239.2,-185.48 232.58,-187.76"/> -<text text-anchor="middle" x="223.8" y="-162.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_13 --> -<g id="node5" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="120" cy="-300" rx="27" ry="18"/> -<text text-anchor="middle" x="120" y="-296.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Add14 --> -<g id="node6" class="node"> -<title>Add14</title> -<ellipse fill="none" stroke="black" cx="153" cy="-214" rx="27" ry="18"/> -<text text-anchor="middle" x="153" y="-210.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add14->Start2 --> -<g id="edge5" class="edge"> -<title>Add14->Start2:p1</title> -<path fill="none" stroke="black" d="M174.12,-225.69C193.67,-236.17 221.18,-252.54 231.18,-266.44"/> -<polygon fill="black" stroke="black" points="228.04,-268.01 235,-276 234.54,-265.42 228.04,-268.01"/> -<text text-anchor="middle" x="171.12" y="-228.29" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add14->Con_13 --> -<g id="edge6" class="edge"> -<title>Add14->Con_13</title> -<path fill="none" stroke="black" d="M146.48,-231.6C141.87,-243.33 135.59,-259.3 130.31,-272.76"/> -<polygon fill="black" stroke="black" points="126.91,-271.85 126.51,-282.44 133.42,-274.41 126.91,-271.85"/> -<text text-anchor="middle" x="143.48" y="-234.2" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_15 --> -<g id="node7" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="380" cy="-300" rx="27" ry="18"/> -<text text-anchor="middle" x="380" y="-296.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Sub16 --> -<g id="node8" class="node"> -<title>Sub16</title> -<ellipse fill="none" stroke="black" cx="317" cy="-214" rx="27" ry="18"/> -<text text-anchor="middle" x="317" y="-210.3" font-family="Times,serif" font-size="14.00">-</text> -</g> -<!-- Sub16->Start2 --> -<g id="edge7" class="edge"> -<title>Sub16->Start2:p1</title> -<path fill="none" stroke="black" d="M304.31,-229.92C290.9,-245.57 270.14,-269.43 258.76,-280.7"/> -<polygon fill="black" stroke="black" points="256.56,-277.98 251,-287 260.97,-283.41 256.56,-277.98"/> -<text text-anchor="middle" x="301.31" y="-232.52" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Sub16->Con_15 --> -<g id="edge8" class="edge"> -<title>Sub16->Con_15</title> -<path fill="none" stroke="black" d="M328.56,-230.41C338.06,-243.08 351.67,-261.23 362.51,-275.68"/> -<polygon fill="black" stroke="black" points="359.72,-277.79 368.52,-283.69 365.32,-273.59 359.72,-277.79"/> -<text text-anchor="middle" x="325.56" y="-233.01" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Scope1_0 --> -<g id="node9" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="105,-31 105,-52 121,-52 121,-31 105,-31"/> -<polygon fill="none" stroke="black" points="105,-31 105,-52 121,-52 121,-31 105,-31"/> -<text text-anchor="start" x="108" y="-37.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="121,-31 121,-52 161,-52 161,-31 121,-31"/> -<text text-anchor="start" x="124" y="-37.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="161,-31 161,-52 192,-52 192,-31 161,-31"/> -<text text-anchor="start" x="164" y="-37.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope1_0->Start2 --> -<g id="edge10" class="edge"> -<title>Scope1_0:Scope1_0_arg->Start2:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M177,-53C177,-72.12 160.6,-70.93 152,-88 122.36,-146.82 79.43,-177.9 117,-232 146.68,-274.74 223.16,-227.66 233.77,-265.81"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="230.33,-266.49 235,-276 237.28,-265.65 230.33,-266.49"/> -</g> -<!-- Scope1_0->If9 --> -<g id="edge9" class="edge"> -<title>Scope1_0:Scope1_0_$ctrl->If9:p0</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M141,-53C141,-81.73 181.94,-74.1 191.86,-94.03"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="188.48,-94.96 194,-104 195.32,-93.49 188.48,-94.96"/> -</g> -<!-- Scope1_1 --> -<g id="node10" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="36,-31 36,-52 52,-52 52,-31 36,-31"/> -<polygon fill="none" stroke="black" points="36,-31 36,-52 52,-52 52,-31 36,-31"/> -<text text-anchor="start" x="39" y="-37.8" font-family="Times,serif" font-size="14.00">1</text> -<polygon fill="none" stroke="black" points="52,-31 52,-52 67,-52 67,-31 52,-31"/> -<text text-anchor="start" x="55" y="-37.8" font-family="Times,serif" font-size="14.00">a</text> -</g> -<!-- Scope1_1->Add14 --> -<g id="edge11" class="edge"> -<title>Scope1_1:Scope1_1_a->Add14</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M60,-53C60,-108.8 102.8,-162.53 130.33,-191.31"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="128.14,-194.07 137.64,-198.75 133.13,-189.17 128.14,-194.07"/> -</g> -<!-- Scope12_0 --> -<g id="node11" class="node"> -<title>Scope12_0</title> -<polygon fill="cyan" stroke="transparent" points="313,-31 313,-52 329,-52 329,-31 313,-31"/> -<polygon fill="none" stroke="black" points="313,-31 313,-52 329,-52 329,-31 313,-31"/> -<text text-anchor="start" x="316" y="-37.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="329,-31 329,-52 369,-52 369,-31 329,-31"/> -<text text-anchor="start" x="332" y="-37.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="369,-31 369,-52 400,-52 400,-31 369,-31"/> -<text text-anchor="start" x="372" y="-37.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope12_0->Start2 --> -<g id="edge13" class="edge"> -<title>Scope12_0:Scope12_0_arg->Start2:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M385,-53C385,-133.82 402.85,-168.39 353,-232 328.7,-263.01 305.02,-246.51 272,-268 265.41,-272.29 263.77,-278.64 260.39,-282.8"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="258.7,-279.72 251,-287 261.56,-286.11 258.7,-279.72"/> -</g> -<!-- Scope12_0->If9 --> -<g id="edge12" class="edge"> -<title>Scope12_0:Scope12_0_$ctrl->If9:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M349,-53C349,-98.16 313.19,-112.94 269.13,-114.79"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="268.93,-111.3 259,-115 269.07,-118.3 268.93,-111.3"/> -</g> -<!-- Scope12_1 --> -<g id="node12" class="node"> -<title>Scope12_1</title> -<polygon fill="cyan" stroke="transparent" points="244,-31 244,-52 260,-52 260,-31 244,-31"/> -<polygon fill="none" stroke="black" points="244,-31 244,-52 260,-52 260,-31 244,-31"/> -<text text-anchor="start" x="247" y="-37.8" font-family="Times,serif" font-size="14.00">1</text> -<polygon fill="none" stroke="black" points="260,-31 260,-52 275,-52 275,-31 260,-31"/> -<text text-anchor="start" x="263" y="-37.8" font-family="Times,serif" font-size="14.00">a</text> -</g> -<!-- Scope12_1->Sub16 --> -<g id="edge14" class="edge"> -<title>Scope12_1:Scope12_1_a->Sub16</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M268,-53C268,-69.44 275,-72.33 280,-88 290.77,-121.73 302.19,-160.92 309.45,-186.29"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="306.09,-187.29 312.2,-195.95 312.83,-185.37 306.09,-187.29"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1006" height="548" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1006 548" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M84,367 C84,391 848.5,364 848.5,388" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #11 · ASSOC · 0: $ctrl</title></path><path class="edge ASSOC" id="e1i1" d="M224,115 C224,139 906.5,364 906.5,388" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #10 · ASSOC · 0: arg</title></path><path class="edge ASSOC" id="e1i2" d="M376,219 C376,243 958,364 958,388" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #14 · ASSOC · 1: a</title></path><path class="edge ASSOC" id="e4i0" d="M204,367 C204,391 848.5,444 848.5,468" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[0] → #12 · ASSOC · 0: $ctrl</title></path><path class="edge ASSOC" id="e4i1" d="M224,115 C224,139 906.5,444 906.5,468" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[1] → #10 · ASSOC · 0: arg</title></path><path class="edge ASSOC" id="e4i2" d="M528,219 C528,243 958,444 958,468" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#4[2] → #16 · ASSOC · 1: a</title></path><path class="edge DATA" id="e8i1" d="M224,118 L224,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #10 · DATA</title></path><path class="edge DATA" id="e8i2" d="M382,118 L382,128 L254,128 L254,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge CTRL" id="e9i0" d="M104,118 L104,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #6 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M224,222 L224,232 L184,232 L184,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #8 · DATA</title></path><path class="edge DATA" id="e14i1" d="M224,118 L224,138 L376,138 L376,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #10 · DATA</title></path><path class="edge DATA" id="e14i2" d="M534,118 L534,128 L406,128 L406,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge DATA" id="e16i1" d="M224,118 L224,138 L528,138 L528,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #10 · DATA</title></path><path class="edge DATA" id="e16i2" d="M686,118 L686,128 L558,128 L558,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(818,388)" style="opacity: 1;"><path class="box" d="M4,0H160Q164,0 164,4V52Q164,56 160,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="82" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="82"/><title>#1 Scope +Type not computed + +[0] → #11 ASSOC 0: $ctrl +[1] → #10 ASSOC 0: arg +[2] → #14 ASSOC 1: a</title><line class="row" x1="0" x2="164" y1="30" y2="30"/><line class="row" x1="61" x2="61" y1="0" y2="30"/><line class="row" x1="116" x2="116" y1="0" y2="30"/><text class="bind" x="30.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="88.5" y="20" text-anchor="middle">0: arg</text><text class="bind" x="140" y="20" text-anchor="middle">1: a</text><circle class="port" cx="30.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="88.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="140" cy="0" r="3" fill="#536477"/><text class="slot" x="30.5" y="-7" text-anchor="middle">0</text><text class="slot" x="88.5" y="-7" text-anchor="middle">1</text><text class="slot" x="140" y="-7" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(44,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(818,468)" style="opacity: 1;"><path class="box" d="M4,0H160Q164,0 164,4V52Q164,56 160,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="82" y="48"><tspan>Scope</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="82"/><title>#4 Scope +Type not computed + +[0] → #12 ASSOC 0: $ctrl +[1] → #10 ASSOC 0: arg +[2] → #16 ASSOC 1: a</title><line class="row" x1="0" x2="164" y1="30" y2="30"/><line class="row" x1="61" x2="61" y1="0" y2="30"/><line class="row" x1="116" x2="116" y1="0" y2="30"/><text class="bind" x="30.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="88.5" y="20" text-anchor="middle">0: arg</text><text class="bind" x="140" y="20" text-anchor="middle">1: a</text><circle class="port" cx="30.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="88.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="140" cy="0" r="3" fill="#536477"/><text class="slot" x="30.5" y="-7" text-anchor="middle">0</text><text class="slot" x="88.5" y="-7" text-anchor="middle">1</text><text class="slot" x="140" y="-7" text-anchor="middle">2</text></g><g class="node" id="n6" data-id="6" transform="translate(44,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #6/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(322,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #1 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(164,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 == +Type not computed + +[0] → — DATA +[1] → #10 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(24,276)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#9 If +Type not computed + +[0] → #6 CTRL +[1] → #8 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n10" data-id="10" transform="translate(164,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n11" data-id="11" transform="translate(24,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #11/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 True +Projection 0 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n12" data-id="12" transform="translate(144,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #12/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 False +Projection 1 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(474,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #2 +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(316,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 + +Type not computed + +[0] → — DATA +[1] → #10 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(626,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 #3 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(468,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 - +Type not computed + +[0] → — DATA +[1] → #10 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph2.json b/chapter05/docs/05-graph2.json new file mode 100644 index 00000000..5980da2b --- /dev/null +++ b/chapter05/docs/05-graph2.json @@ -0,0 +1,27 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 17, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 5, "role": "ASSOC", "label": "0: arg"}, {"idx": 2, "def": 18, "role": "ASSOC", "label": "1: a"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 5, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 6, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 0}}, + {"id": 7, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 1}}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "CTRL", "label": null}, {"idx": 2, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 18, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 17, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 9, "par": 0, "nodes": [6, 8, 9, 10, 14, 16, 17, 18]} + ] +} diff --git a/chapter05/docs/05-graph2.svg b/chapter05/docs/05-graph2.svg index d5e48a9e..bd06978a 100644 --- a/chapter05/docs/05-graph2.svg +++ b/chapter05/docs/05-graph2.svg @@ -1,229 +1,125 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="343pt" height="428pt" - viewBox="0.00 0.00 343.03 428.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 424)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-424 339.03,-424 339.03,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-88 8,-412 282,-412 282,-88 8,-88"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="67,-8 67,-76 267,-76 267,-8 67,-8"/> -</g> -<g id="clust4" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="75,-16 75,-68 145,-68 145,-16 75,-16"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="113,-375 113,-400 194,-400 194,-375 113,-375"/> -<polygon fill="none" stroke="black" points="113,-375 113,-400 194,-400 194,-375 113,-375"/> -<text text-anchor="start" x="135" y="-383.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="113,-344 113,-375 194,-375 194,-344 113,-344"/> -<polygon fill="yellow" stroke="transparent" points="118,-349 118,-370 158,-370 158,-349 118,-349"/> -<polygon fill="none" stroke="black" points="118,-349 118,-370 158,-370 158,-349 118,-349"/> -<text text-anchor="start" x="121" y="-355.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="158,-349 158,-370 189,-370 189,-349 158,-349"/> -<text text-anchor="start" x="161" y="-355.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Con_7 --> -<g id="node2" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="247" cy="-372" rx="27" ry="18"/> -<text text-anchor="middle" x="247" y="-368.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode8 --> -<g id="node3" class="node"> -<title>EQNode8</title> -<ellipse fill="none" stroke="black" cx="247" cy="-286" rx="27" ry="18"/> -<text text-anchor="middle" x="247" y="-282.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode8->Start2 --> -<g id="edge1" class="edge"> -<title>EQNode8->Start2:p1</title> -<path fill="none" stroke="black" d="M236.57,-302.62C225.76,-318.5 208.98,-342.28 198.26,-353.17"/> -<polygon fill="black" stroke="black" points="196.15,-350.37 190,-359 200.19,-356.09 196.15,-350.37"/> -<text text-anchor="middle" x="233.57" y="-305.22" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode8->Con_7 --> -<g id="edge2" class="edge"> -<title>EQNode8->Con_7</title> -<path fill="none" stroke="black" d="M247,-304.4C247,-315.74 247,-330.77 247,-343.68"/> -<polygon fill="black" stroke="black" points="243.5,-343.9 247,-353.9 250.5,-343.9 243.5,-343.9"/> -<text text-anchor="middle" x="244" y="-307" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If9 --> -<g id="node4" class="node"> -<title>If9</title> -<polygon fill="yellow" stroke="transparent" points="172,-203 172,-228 266,-228 266,-203 172,-203"/> -<polygon fill="none" stroke="black" points="172,-203 172,-228 266,-228 266,-203 172,-203"/> -<text text-anchor="start" x="213.5" y="-211.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="172,-172 172,-203 266,-203 266,-172 172,-172"/> -<polygon fill="yellow" stroke="transparent" points="177,-177 177,-198 217,-198 217,-177 177,-177"/> -<polygon fill="none" stroke="black" points="177,-177 177,-198 217,-198 217,-177 177,-177"/> -<text text-anchor="start" x="180" y="-183.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="217,-177 217,-198 261,-198 261,-177 217,-177"/> -<polygon fill="none" stroke="black" points="217,-177 217,-198 261,-198 261,-177 217,-177"/> -<text text-anchor="start" x="220" y="-183.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If9->Start2 --> -<g id="edge3" class="edge"> -<title>If9->Start2:p0</title> -<path fill="none" stroke="red" d="M210.31,-232.18C203.59,-253.4 193.07,-281.57 179,-304 166.9,-323.28 145.68,-322.25 139.64,-338.02"/> -<polygon fill="red" stroke="red" points="136.17,-337.56 138,-348 143.08,-338.7 136.17,-337.56"/> -<text text-anchor="middle" x="207.31" y="-234.78" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If9->EQNode8 --> -<g id="edge4" class="edge"> -<title>If9->EQNode8</title> -<path fill="none" stroke="black" d="M229.43,-232.28C232.3,-240.9 235.39,-250.17 238.16,-258.49"/> -<polygon fill="black" stroke="black" points="234.87,-259.69 241.36,-268.07 241.51,-257.48 234.87,-259.69"/> -<text text-anchor="middle" x="226.43" y="-234.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_13 --> -<g id="node5" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="135" cy="-286" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-282.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Add14 --> -<g id="node6" class="node"> -<title>Add14</title> -<ellipse fill="none" stroke="black" cx="119" cy="-200" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-196.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add14->Start2 --> -<g id="edge5" class="edge"> -<title>Add14->Start2:p1</title> -<path fill="none" stroke="black" d="M134.23,-215.02C146.68,-227.55 163.4,-247.1 171,-268 181.92,-298.04 175.64,-309.96 174.25,-337.87"/> -<polygon fill="black" stroke="black" points="170.75,-337.92 174,-348 177.75,-338.09 170.75,-337.92"/> -<text text-anchor="middle" x="131.23" y="-217.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add14->Con_13 --> -<g id="edge6" class="edge"> -<title>Add14->Con_13</title> -<path fill="none" stroke="black" d="M122.24,-218C124.43,-229.5 127.37,-244.93 129.87,-258.08"/> -<polygon fill="black" stroke="black" points="126.46,-258.86 131.77,-268.03 133.33,-257.55 126.46,-258.86"/> -<text text-anchor="middle" x="119.24" y="-220.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_15 --> -<g id="node7" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="43" cy="-286" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-282.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Sub16 --> -<g id="node8" class="node"> -<title>Sub16</title> -<ellipse fill="none" stroke="black" cx="47" cy="-200" rx="27" ry="18"/> -<text text-anchor="middle" x="47" y="-196.3" font-family="Times,serif" font-size="14.00">-</text> -</g> -<!-- Sub16->Start2 --> -<g id="edge7" class="edge"> -<title>Sub16->Start2:p1</title> -<path fill="none" stroke="black" d="M54.69,-217.49C67.53,-244.81 92.56,-297.14 99,-304 122.77,-329.31 164.37,-313.46 172.57,-338.01"/> -<polygon fill="black" stroke="black" points="169.12,-338.6 174,-348 176.05,-337.61 169.12,-338.6"/> -<text text-anchor="middle" x="51.69" y="-220.09" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Sub16->Con_15 --> -<g id="edge8" class="edge"> -<title>Sub16->Con_15</title> -<path fill="none" stroke="black" d="M46.19,-218C45.65,-229.31 44.93,-244.42 44.31,-257.43"/> -<polygon fill="black" stroke="black" points="40.8,-257.58 43.82,-267.74 47.79,-257.92 40.8,-257.58"/> -<text text-anchor="middle" x="43.19" y="-220.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region17 --> -<g id="node9" class="node"> -<title>Region17</title> -<polygon fill="yellow" stroke="black" points="232,-132 166,-132 166,-96 232,-96 232,-132"/> -<text text-anchor="middle" x="199" y="-110.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region17->If9 --> -<g id="edge9" class="edge"> -<title>Region17->If9:p0</title> -<path fill="none" stroke="red" d="M198.14,-132.09C197.72,-141.54 197.27,-153.77 197.08,-165.68"/> -<polygon fill="red" stroke="red" points="193.58,-165.97 197,-176 200.58,-166.03 193.58,-165.97"/> -<text text-anchor="middle" x="195.14" y="-134.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region17->If9 --> -<g id="edge10" class="edge"> -<title>Region17->If9:p1</title> -<path fill="none" stroke="red" d="M217.83,-132.05C226.1,-141.05 234.63,-152.92 237.76,-165.89"/> -<polygon fill="red" stroke="red" points="234.31,-166.5 239,-176 241.25,-165.65 234.31,-166.5"/> -<text text-anchor="middle" x="214.83" y="-134.65" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a18 --> -<g id="node10" class="node"> -<title>Phi_a18</title> -<ellipse fill="lightyellow" stroke="black" cx="119" cy="-114" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-110.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a18->Add14 --> -<g id="edge12" class="edge"> -<title>Phi_a18->Add14</title> -<path fill="none" stroke="black" d="M119,-132.4C119,-143.74 119,-158.77 119,-171.68"/> -<polygon fill="black" stroke="black" points="115.5,-171.9 119,-181.9 122.5,-171.9 115.5,-171.9"/> -<text text-anchor="middle" x="116" y="-135" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a18->Sub16 --> -<g id="edge13" class="edge"> -<title>Phi_a18->Sub16</title> -<path fill="none" stroke="black" d="M106.13,-130.02C95.07,-142.92 78.96,-161.71 66.35,-176.42"/> -<polygon fill="black" stroke="black" points="63.61,-174.24 59.76,-184.11 68.93,-178.8 63.61,-174.24"/> -<text text-anchor="middle" x="103.13" y="-132.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a18->Region17 --> -<g id="edge11" class="edge"> -<title>Phi_a18->Region17</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M146.19,-114C149.39,-114 152.58,-114 155.78,-114"/> -<polygon fill="black" stroke="black" points="155.99,-117.5 165.99,-114 155.99,-110.5 155.99,-117.5"/> -<text text-anchor="middle" x="149.19" y="-107.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Scope1_0 --> -<g id="node11" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="164,-31 164,-52 180,-52 180,-31 164,-31"/> -<polygon fill="none" stroke="black" points="164,-31 164,-52 180,-52 180,-31 164,-31"/> -<text text-anchor="start" x="167" y="-37.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="180,-31 180,-52 220,-52 220,-31 180,-31"/> -<text text-anchor="start" x="183" y="-37.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="220,-31 220,-52 251,-52 251,-31 220,-31"/> -<text text-anchor="start" x="223" y="-37.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope1_0->Start2 --> -<g id="edge15" class="edge"> -<title>Scope1_0:Scope1_0_arg->Start2:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M252,-41C369.7,-41 344.88,-203.88 283,-304 264.19,-334.43 240.54,-319.81 211,-340 204.51,-344.44 202.84,-350.75 199.44,-354.86"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="197.75,-351.78 190,-359 200.56,-358.19 197.75,-351.78"/> -</g> -<!-- Scope1_0->Region17 --> -<g id="edge14" class="edge"> -<title>Scope1_0:Scope1_0_$ctrl->Region17</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M200,-53C200,-63.75 199.84,-75.58 199.64,-85.87"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="196.14,-85.86 199.44,-95.93 203.14,-86.01 196.14,-85.86"/> -</g> -<!-- Scope1_1 --> -<g id="node12" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="95,-31 95,-52 111,-52 111,-31 95,-31"/> -<polygon fill="none" stroke="black" points="95,-31 95,-52 111,-52 111,-31 95,-31"/> -<text text-anchor="start" x="98" y="-37.8" font-family="Times,serif" font-size="14.00">1</text> -<polygon fill="none" stroke="black" points="111,-31 111,-52 126,-52 126,-31 111,-31"/> -<text text-anchor="start" x="114" y="-37.8" font-family="Times,serif" font-size="14.00">a</text> -</g> -<!-- Scope1_1->Phi_a18 --> -<g id="edge16" class="edge"> -<title>Scope1_1:Scope1_1_a->Phi_a18</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M119,-53C119,-63.75 119,-75.58 119,-85.87"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="115.5,-85.93 119,-95.93 122.5,-85.93 115.5,-85.93"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="996" height="631" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 996 631" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M306,530 C306,554 838.5,527 838.5,551" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #17 · ASSOC · 0: $ctrl</title></path><path class="edge ASSOC" id="e1i1" d="M356,115 C356,139 896.5,527 896.5,551" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg</title></path><path class="edge ASSOC" id="e1i2" d="M458,530 C458,554 948,527 948,551" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #18 · ASSOC · 1: a</title></path><path class="edge DATA" id="e8i1" d="M356,118 L356,128 L307,128 L307,225" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #5 · DATA</title></path><path class="edge DATA" id="e8i2" d="M84,118 L84,128 L226,128 L226,215 L337,215 L337,225" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge CTRL" id="e9i0" d="M236,118 L236,329" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #4 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M307,281 L307,291 L316,291 L316,329" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #8 · DATA</title></path><path class="edge DATA" id="e14i1" d="M356,118 L356,128 L494,128 L494,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #5 · DATA</title></path><path class="edge DATA" id="e14i2" d="M524,118 L524,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge DATA" id="e16i1" d="M356,118 L356,128 L513,128 L513,291 L646,291 L646,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #5 · DATA</title></path><path class="edge DATA" id="e16i2" d="M676,118 L676,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path><path class="edge CTRL" id="e17i1" d="M216,429 L216,439 L306,439 L306,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[1] → #6 · CTRL</title></path><path class="edge CTRL" id="e17i2" d="M336,429 L336,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[2] → #10 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M494,399.66666666666663 L494,439 L438,439 L438,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #14 · DATA</title></path><path class="edge DATA" id="e18i2" d="M646,399.66666666666663 L646,449 L478,449 L478,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #16 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(808,551)" style="opacity: 1;"><path class="box" d="M4,0H160Q164,0 164,4V52Q164,56 160,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="82" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="82"/><title>#1 Scope +Type not computed + +[0] → #17 ASSOC 0: $ctrl +[1] → #5 ASSOC 0: arg +[2] → #18 ASSOC 1: a</title><line class="row" x1="0" x2="164" y1="30" y2="30"/><line class="row" x1="61" x2="61" y1="0" y2="30"/><line class="row" x1="116" x2="116" y1="0" y2="30"/><text class="bind" x="30.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="88.5" y="20" text-anchor="middle">0: arg</text><text class="bind" x="140" y="20" text-anchor="middle">1: a</text><circle class="port" cx="30.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="88.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="140" cy="0" r="3" fill="#536477"/><text class="slot" x="30.5" y="-7" text-anchor="middle">0</text><text class="slot" x="88.5" y="-7" text-anchor="middle">1</text><text class="slot" x="140" y="-7" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #5/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n6" data-id="6" transform="translate(156,379)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #6/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 True +Projection 0 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #1 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(247,231)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 == +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(156,335)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#9 If +Type not computed + +[0] → #4 CTRL +[1] → #8 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n10" data-id="10" transform="translate(276,379)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 False +Projection 1 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(464,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #2 +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(434,349.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 + +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(616,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 #3 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(586,349.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 - +Type not computed + +[0] → — DATA +[1] → #5 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(246,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 Region +Type not computed + +[0] → — DATA +[1] → #6 CTRL +[2] → #10 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(398,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 φ_a +Type not computed + +[0] → #17 ASSOC +[1] → #14 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #17</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(144,171)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><title>If · 8 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #9"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph3.json b/chapter05/docs/05-graph3.json new file mode 100644 index 00000000..16d74821 --- /dev/null +++ b/chapter05/docs/05-graph3.json @@ -0,0 +1,28 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph3.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 1}}, + {"id": 7, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 6, "role": "CTRL", "label": null}], "proj": null}, + {"id": 18, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 17, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}, {"idx": 1, "def": 18, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 9, "par": 0, "nodes": [5, 6, 8, 9, 14, 16, 17, 18]} + ] +} diff --git a/chapter05/docs/05-graph3.svg b/chapter05/docs/05-graph3.svg index 855fdc2c..50255072 100644 --- a/chapter05/docs/05-graph3.svg +++ b/chapter05/docs/05-graph3.svg @@ -1,216 +1,127 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="298pt" height="492pt" - viewBox="0.00 0.00 298.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-488 294,-488 294,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-476 282,-476 282,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="113,-439 113,-464 194,-464 194,-439 113,-439"/> -<polygon fill="none" stroke="black" points="113,-439 113,-464 194,-464 194,-439 113,-439"/> -<text text-anchor="start" x="135" y="-447.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="113,-408 113,-439 194,-439 194,-408 113,-408"/> -<polygon fill="yellow" stroke="transparent" points="118,-413 118,-434 158,-434 158,-413 118,-413"/> -<polygon fill="none" stroke="black" points="118,-413 118,-434 158,-434 158,-413 118,-413"/> -<text text-anchor="start" x="121" y="-419.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="158,-413 158,-434 189,-434 189,-413 158,-413"/> -<text text-anchor="start" x="161" y="-419.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="185,-52 131,-52 131,-16 185,-16 185,-52"/> -<text text-anchor="middle" x="158" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return19 --> -<g id="node12" class="node"> -<title>Return19</title> -<polygon fill="yellow" stroke="black" points="191,-124 125,-124 125,-88 191,-88 191,-124"/> -<text text-anchor="middle" x="158" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return19 --> -<g id="edge1" class="edge"> -<title>Stop3->Return19</title> -<path fill="none" stroke="red" d="M158,-52.3C158,-60.02 158,-69.29 158,-77.89"/> -<polygon fill="red" stroke="red" points="154.5,-77.9 158,-87.9 161.5,-77.9 154.5,-77.9"/> -<text text-anchor="middle" x="155" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_7 --> -<g id="node3" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="247" cy="-436" rx="27" ry="18"/> -<text text-anchor="middle" x="247" y="-432.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode8 --> -<g id="node4" class="node"> -<title>EQNode8</title> -<ellipse fill="none" stroke="black" cx="247" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="247" y="-346.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode8->Start2 --> -<g id="edge2" class="edge"> -<title>EQNode8->Start2:p1</title> -<path fill="none" stroke="black" d="M236.57,-366.62C225.76,-382.5 208.98,-406.28 198.26,-417.17"/> -<polygon fill="black" stroke="black" points="196.15,-414.37 190,-423 200.19,-420.09 196.15,-414.37"/> -<text text-anchor="middle" x="233.57" y="-369.22" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode8->Con_7 --> -<g id="edge3" class="edge"> -<title>EQNode8->Con_7</title> -<path fill="none" stroke="black" d="M247,-368.4C247,-379.74 247,-394.77 247,-407.68"/> -<polygon fill="black" stroke="black" points="243.5,-407.9 247,-417.9 250.5,-407.9 243.5,-407.9"/> -<text text-anchor="middle" x="244" y="-371" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If9 --> -<g id="node5" class="node"> -<title>If9</title> -<polygon fill="yellow" stroke="transparent" points="172,-267 172,-292 266,-292 266,-267 172,-267"/> -<polygon fill="none" stroke="black" points="172,-267 172,-292 266,-292 266,-267 172,-267"/> -<text text-anchor="start" x="213.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="172,-236 172,-267 266,-267 266,-236 172,-236"/> -<polygon fill="yellow" stroke="transparent" points="177,-241 177,-262 217,-262 217,-241 177,-241"/> -<polygon fill="none" stroke="black" points="177,-241 177,-262 217,-262 217,-241 177,-241"/> -<text text-anchor="start" x="180" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="217,-241 217,-262 261,-262 261,-241 217,-241"/> -<polygon fill="none" stroke="black" points="217,-241 217,-262 261,-262 261,-241 217,-241"/> -<text text-anchor="start" x="220" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If9->Start2 --> -<g id="edge4" class="edge"> -<title>If9->Start2:p0</title> -<path fill="none" stroke="red" d="M210.31,-296.18C203.59,-317.4 193.07,-345.57 179,-368 166.9,-387.28 145.68,-386.25 139.64,-402.02"/> -<polygon fill="red" stroke="red" points="136.17,-401.56 138,-412 143.08,-402.7 136.17,-401.56"/> -<text text-anchor="middle" x="207.31" y="-298.78" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If9->EQNode8 --> -<g id="edge5" class="edge"> -<title>If9->EQNode8</title> -<path fill="none" stroke="black" d="M229.43,-296.28C232.3,-304.9 235.39,-314.17 238.16,-322.49"/> -<polygon fill="black" stroke="black" points="234.87,-323.69 241.36,-332.07 241.51,-321.48 234.87,-323.69"/> -<text text-anchor="middle" x="226.43" y="-298.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_13 --> -<g id="node6" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="43" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-346.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Add14 --> -<g id="node7" class="node"> -<title>Add14</title> -<ellipse fill="none" stroke="black" cx="47" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="47" y="-260.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add14->Start2 --> -<g id="edge6" class="edge"> -<title>Add14->Start2:p1</title> -<path fill="none" stroke="black" d="M54.69,-281.49C67.53,-308.81 92.56,-361.14 99,-368 122.77,-393.31 164.37,-377.46 172.57,-402.01"/> -<polygon fill="black" stroke="black" points="169.12,-402.6 174,-412 176.05,-401.61 169.12,-402.6"/> -<text text-anchor="middle" x="51.69" y="-284.09" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add14->Con_13 --> -<g id="edge7" class="edge"> -<title>Add14->Con_13</title> -<path fill="none" stroke="black" d="M46.19,-282C45.65,-293.31 44.93,-308.42 44.31,-321.43"/> -<polygon fill="black" stroke="black" points="40.8,-321.58 43.82,-331.74 47.79,-321.92 40.8,-321.58"/> -<text text-anchor="middle" x="43.19" y="-284.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_15 --> -<g id="node8" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="135" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-346.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Sub16 --> -<g id="node9" class="node"> -<title>Sub16</title> -<ellipse fill="none" stroke="black" cx="119" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-260.3" font-family="Times,serif" font-size="14.00">-</text> -</g> -<!-- Sub16->Start2 --> -<g id="edge8" class="edge"> -<title>Sub16->Start2:p1</title> -<path fill="none" stroke="black" d="M134.23,-279.02C146.68,-291.55 163.4,-311.1 171,-332 181.92,-362.04 175.64,-373.96 174.25,-401.87"/> -<polygon fill="black" stroke="black" points="170.75,-401.92 174,-412 177.75,-402.09 170.75,-401.92"/> -<text text-anchor="middle" x="131.23" y="-281.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Sub16->Con_15 --> -<g id="edge9" class="edge"> -<title>Sub16->Con_15</title> -<path fill="none" stroke="black" d="M122.24,-282C124.43,-293.5 127.37,-308.93 129.87,-322.08"/> -<polygon fill="black" stroke="black" points="126.46,-322.86 131.77,-332.03 133.33,-321.55 126.46,-322.86"/> -<text text-anchor="middle" x="119.24" y="-284.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region17 --> -<g id="node10" class="node"> -<title>Region17</title> -<polygon fill="yellow" stroke="black" points="230,-196 164,-196 164,-160 230,-160 230,-196"/> -<text text-anchor="middle" x="197" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region17->If9 --> -<g id="edge10" class="edge"> -<title>Region17->If9:p0</title> -<path fill="none" stroke="red" d="M197,-196.09C197,-205.55 197,-217.77 197,-229.69"/> -<polygon fill="red" stroke="red" points="193.5,-230 197,-240 200.5,-230 193.5,-230"/> -<text text-anchor="middle" x="194" y="-198.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region17->If9 --> -<g id="edge11" class="edge"> -<title>Region17->If9:p1</title> -<path fill="none" stroke="red" d="M217.02,-196.12C225.64,-205.06 234.48,-216.84 237.71,-229.84"/> -<polygon fill="red" stroke="red" points="234.27,-230.52 239,-240 241.22,-229.64 234.27,-230.52"/> -<text text-anchor="middle" x="214.02" y="-198.72" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a18 --> -<g id="node11" class="node"> -<title>Phi_a18</title> -<ellipse fill="lightyellow" stroke="black" cx="119" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-174.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a18->Add14 --> -<g id="edge13" class="edge"> -<title>Phi_a18->Add14</title> -<path fill="none" stroke="black" d="M106.13,-194.02C95.07,-206.92 78.96,-225.71 66.35,-240.42"/> -<polygon fill="black" stroke="black" points="63.61,-238.24 59.76,-248.11 68.93,-242.8 63.61,-238.24"/> -<text text-anchor="middle" x="103.13" y="-196.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a18->Sub16 --> -<g id="edge14" class="edge"> -<title>Phi_a18->Sub16</title> -<path fill="none" stroke="black" d="M119,-196.4C119,-207.74 119,-222.77 119,-235.68"/> -<polygon fill="black" stroke="black" points="115.5,-235.9 119,-245.9 122.5,-235.9 115.5,-235.9"/> -<text text-anchor="middle" x="116" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a18->Region17 --> -<g id="edge12" class="edge"> -<title>Phi_a18->Region17</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M146.12,-178C148.58,-178 151.04,-178 153.5,-178"/> -<polygon fill="black" stroke="black" points="153.61,-181.5 163.61,-178 153.61,-174.5 153.61,-181.5"/> -<text text-anchor="middle" x="149.12" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return19->Region17 --> -<g id="edge15" class="edge"> -<title>Return19->Region17</title> -<path fill="none" stroke="red" d="M167.64,-124.3C172.13,-132.36 177.56,-142.11 182.52,-151.02"/> -<polygon fill="red" stroke="red" points="179.55,-152.86 187.47,-159.9 185.66,-149.46 179.55,-152.86"/> -<text text-anchor="middle" x="164.64" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return19->Phi_a18 --> -<g id="edge16" class="edge"> -<title>Return19->Phi_a18</title> -<path fill="none" stroke="black" d="M148.36,-124.3C143.69,-132.68 138,-142.9 132.87,-152.1"/> -<polygon fill="black" stroke="black" points="129.8,-150.42 127.99,-160.86 135.92,-153.82 129.8,-150.42"/> -<text text-anchor="middle" x="145.36" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="760" height="752" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 752" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M326,651 C326,675 380,678 380,702" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #19 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M356,118 L356,128 L307,128 L307,225" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M84,118 L84,128 L226,128 L226,215 L337,215 L337,225" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge CTRL" id="e9i0" d="M236,118 L236,329" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #1 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M307,281 L307,291 L316,291 L316,329" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #8 · DATA</title></path><path class="edge DATA" id="e14i1" d="M356,118 L356,128 L494,128 L494,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #4 · DATA</title></path><path class="edge DATA" id="e14i2" d="M524,118 L524,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge DATA" id="e16i1" d="M356,118 L356,128 L513,128 L513,291 L646,291 L646,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #4 · DATA</title></path><path class="edge DATA" id="e16i2" d="M676,118 L676,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path><path class="edge CTRL" id="e17i1" d="M216,429 L216,439 L306,439 L306,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e17i2" d="M336,429 L336,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[2] → #6 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M494,399.66666666666663 L494,439 L438,439 L438,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #14 · DATA</title></path><path class="edge DATA" id="e18i2" d="M646,399.66666666666663 L646,449 L478,449 L478,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #16 · DATA</title></path><path class="edge CTRL" id="e19i0" d="M306,533 L306,598" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[0] → #17 · CTRL</title></path><path class="edge DATA" id="e19i1" d="M458,533 L458,560 L346,560 L346,598" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #18 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(344,702)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #19 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(156,379)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(276,379)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #1 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(247,231)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(156,335)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#9 If +Type not computed + +[0] → #1 CTRL +[1] → #8 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n13" data-id="13" transform="translate(464,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #2 +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(434,349.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 + +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(616,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 #3 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(586,349.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 - +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(246,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #6 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(398,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 φ_a +Type not computed + +[0] → #17 ASSOC +[1] → #14 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #17</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n19" data-id="19" transform="translate(266,604)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 Return +Type not computed + +[0] → #17 CTRL +[1] → #18 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(144,171)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><title>If · 8 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #9"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph4.json b/chapter05/docs/05-graph4.json new file mode 100644 index 00000000..36527f8d --- /dev/null +++ b/chapter05/docs/05-graph4.json @@ -0,0 +1,28 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph4.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, + {"id": 6, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, + {"id": 14, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 15, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 14, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 11, "role": "CTRL", "label": null}], "proj": null}, + {"id": 17, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 16, "role": "ASSOC", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 10, "par": 0, "nodes": [5, 7, 9, 10, 11, 15, 16, 17]} + ] +} diff --git a/chapter05/docs/05-graph4.svg b/chapter05/docs/05-graph4.svg index 3fcee500..58f0cb18 100644 --- a/chapter05/docs/05-graph4.svg +++ b/chapter05/docs/05-graph4.svg @@ -1,216 +1,127 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="298pt" height="492pt" - viewBox="0.00 0.00 298.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-488 294,-488 294,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-476 282,-476 282,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="113,-439 113,-464 194,-464 194,-439 113,-439"/> -<polygon fill="none" stroke="black" points="113,-439 113,-464 194,-464 194,-439 113,-439"/> -<text text-anchor="start" x="135" y="-447.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="113,-408 113,-439 194,-439 194,-408 113,-408"/> -<polygon fill="yellow" stroke="transparent" points="118,-413 118,-434 158,-434 158,-413 118,-413"/> -<polygon fill="none" stroke="black" points="118,-413 118,-434 158,-434 158,-413 118,-413"/> -<text text-anchor="start" x="121" y="-419.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="158,-413 158,-434 189,-434 189,-413 158,-413"/> -<text text-anchor="start" x="161" y="-419.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="185,-52 131,-52 131,-16 185,-16 185,-52"/> -<text text-anchor="middle" x="158" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return18 --> -<g id="node12" class="node"> -<title>Return18</title> -<polygon fill="yellow" stroke="black" points="191,-124 125,-124 125,-88 191,-88 191,-124"/> -<text text-anchor="middle" x="158" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return18 --> -<g id="edge1" class="edge"> -<title>Stop3->Return18</title> -<path fill="none" stroke="red" d="M158,-52.3C158,-60.02 158,-69.29 158,-77.89"/> -<polygon fill="red" stroke="red" points="154.5,-77.9 158,-87.9 161.5,-77.9 154.5,-77.9"/> -<text text-anchor="middle" x="155" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="43" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-346.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- EQNode7 --> -<g id="node4" class="node"> -<title>EQNode7</title> -<ellipse fill="none" stroke="black" cx="47" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="47" y="-260.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode7->Start2 --> -<g id="edge2" class="edge"> -<title>EQNode7->Start2:p1</title> -<path fill="none" stroke="black" d="M54.69,-281.49C67.53,-308.81 92.56,-361.14 99,-368 122.77,-393.31 164.37,-377.46 172.57,-402.01"/> -<polygon fill="black" stroke="black" points="169.12,-402.6 174,-412 176.05,-401.61 169.12,-402.6"/> -<text text-anchor="middle" x="51.69" y="-284.09" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode7->Con_6 --> -<g id="edge3" class="edge"> -<title>EQNode7->Con_6</title> -<path fill="none" stroke="black" d="M46.19,-282C45.65,-293.31 44.93,-308.42 44.31,-321.43"/> -<polygon fill="black" stroke="black" points="40.8,-321.58 43.82,-331.74 47.79,-321.92 40.8,-321.58"/> -<text text-anchor="middle" x="43.19" y="-284.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_8 --> -<g id="node5" class="node"> -<title>Con_8</title> -<ellipse fill="none" stroke="black" cx="247" cy="-436" rx="27" ry="18"/> -<text text-anchor="middle" x="247" y="-432.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode9 --> -<g id="node6" class="node"> -<title>EQNode9</title> -<ellipse fill="none" stroke="black" cx="247" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="247" y="-346.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode9->Start2 --> -<g id="edge4" class="edge"> -<title>EQNode9->Start2:p1</title> -<path fill="none" stroke="black" d="M236.57,-366.62C225.76,-382.5 208.98,-406.28 198.26,-417.17"/> -<polygon fill="black" stroke="black" points="196.15,-414.37 190,-423 200.19,-420.09 196.15,-414.37"/> -<text text-anchor="middle" x="233.57" y="-369.22" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode9->Con_8 --> -<g id="edge5" class="edge"> -<title>EQNode9->Con_8</title> -<path fill="none" stroke="black" d="M247,-368.4C247,-379.74 247,-394.77 247,-407.68"/> -<polygon fill="black" stroke="black" points="243.5,-407.9 247,-417.9 250.5,-407.9 243.5,-407.9"/> -<text text-anchor="middle" x="244" y="-371" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If10 --> -<g id="node7" class="node"> -<title>If10</title> -<polygon fill="yellow" stroke="transparent" points="172,-267 172,-292 266,-292 266,-267 172,-267"/> -<polygon fill="none" stroke="black" points="172,-267 172,-292 266,-292 266,-267 172,-267"/> -<text text-anchor="start" x="213.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="172,-236 172,-267 266,-267 266,-236 172,-236"/> -<polygon fill="yellow" stroke="transparent" points="177,-241 177,-262 217,-262 217,-241 177,-241"/> -<polygon fill="none" stroke="black" points="177,-241 177,-262 217,-262 217,-241 177,-241"/> -<text text-anchor="start" x="180" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="217,-241 217,-262 261,-262 261,-241 217,-241"/> -<polygon fill="none" stroke="black" points="217,-241 217,-262 261,-262 261,-241 217,-241"/> -<text text-anchor="start" x="220" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If10->Start2 --> -<g id="edge6" class="edge"> -<title>If10->Start2:p0</title> -<path fill="none" stroke="red" d="M210.31,-296.18C203.59,-317.4 193.07,-345.57 179,-368 166.9,-387.28 145.68,-386.25 139.64,-402.02"/> -<polygon fill="red" stroke="red" points="136.17,-401.56 138,-412 143.08,-402.7 136.17,-401.56"/> -<text text-anchor="middle" x="207.31" y="-298.78" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If10->EQNode9 --> -<g id="edge7" class="edge"> -<title>If10->EQNode9</title> -<path fill="none" stroke="black" d="M229.43,-296.28C232.3,-304.9 235.39,-314.17 238.16,-322.49"/> -<polygon fill="black" stroke="black" points="234.87,-323.69 241.36,-332.07 241.51,-321.48 234.87,-323.69"/> -<text text-anchor="middle" x="226.43" y="-298.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_14 --> -<g id="node8" class="node"> -<title>Con_14</title> -<ellipse fill="none" stroke="black" cx="135" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-346.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- EQNode15 --> -<g id="node9" class="node"> -<title>EQNode15</title> -<ellipse fill="none" stroke="black" cx="119" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-260.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode15->Start2 --> -<g id="edge8" class="edge"> -<title>EQNode15->Start2:p1</title> -<path fill="none" stroke="black" d="M134.23,-279.02C146.68,-291.55 163.4,-311.1 171,-332 181.92,-362.04 175.64,-373.96 174.25,-401.87"/> -<polygon fill="black" stroke="black" points="170.75,-401.92 174,-412 177.75,-402.09 170.75,-401.92"/> -<text text-anchor="middle" x="131.23" y="-281.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode15->Con_14 --> -<g id="edge9" class="edge"> -<title>EQNode15->Con_14</title> -<path fill="none" stroke="black" d="M122.24,-282C124.43,-293.5 127.37,-308.93 129.87,-322.08"/> -<polygon fill="black" stroke="black" points="126.46,-322.86 131.77,-332.03 133.33,-321.55 126.46,-322.86"/> -<text text-anchor="middle" x="119.24" y="-284.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region16 --> -<g id="node10" class="node"> -<title>Region16</title> -<polygon fill="yellow" stroke="black" points="230,-196 164,-196 164,-160 230,-160 230,-196"/> -<text text-anchor="middle" x="197" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region16->If10 --> -<g id="edge10" class="edge"> -<title>Region16->If10:p0</title> -<path fill="none" stroke="red" d="M197,-196.09C197,-205.55 197,-217.77 197,-229.69"/> -<polygon fill="red" stroke="red" points="193.5,-230 197,-240 200.5,-230 193.5,-230"/> -<text text-anchor="middle" x="194" y="-198.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region16->If10 --> -<g id="edge11" class="edge"> -<title>Region16->If10:p1</title> -<path fill="none" stroke="red" d="M217.02,-196.12C225.64,-205.06 234.48,-216.84 237.71,-229.84"/> -<polygon fill="red" stroke="red" points="234.27,-230.52 239,-240 241.22,-229.64 234.27,-230.52"/> -<text text-anchor="middle" x="214.02" y="-198.72" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a17 --> -<g id="node11" class="node"> -<title>Phi_a17</title> -<ellipse fill="lightyellow" stroke="black" cx="119" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="119" y="-174.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a17->EQNode7 --> -<g id="edge14" class="edge"> -<title>Phi_a17->EQNode7</title> -<path fill="none" stroke="black" d="M106.13,-194.02C95.07,-206.92 78.96,-225.71 66.35,-240.42"/> -<polygon fill="black" stroke="black" points="63.61,-238.24 59.76,-248.11 68.93,-242.8 63.61,-238.24"/> -<text text-anchor="middle" x="103.13" y="-196.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a17->EQNode15 --> -<g id="edge13" class="edge"> -<title>Phi_a17->EQNode15</title> -<path fill="none" stroke="black" d="M119,-196.4C119,-207.74 119,-222.77 119,-235.68"/> -<polygon fill="black" stroke="black" points="115.5,-235.9 119,-245.9 122.5,-235.9 115.5,-235.9"/> -<text text-anchor="middle" x="116" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a17->Region16 --> -<g id="edge12" class="edge"> -<title>Phi_a17->Region16</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M146.12,-178C148.58,-178 151.04,-178 153.5,-178"/> -<polygon fill="black" stroke="black" points="153.61,-181.5 163.61,-178 153.61,-174.5 153.61,-181.5"/> -<text text-anchor="middle" x="149.12" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return18->Region16 --> -<g id="edge15" class="edge"> -<title>Return18->Region16</title> -<path fill="none" stroke="red" d="M167.64,-124.3C172.13,-132.36 177.56,-142.11 182.52,-151.02"/> -<polygon fill="red" stroke="red" points="179.55,-152.86 187.47,-159.9 185.66,-149.46 179.55,-152.86"/> -<text text-anchor="middle" x="164.64" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return18->Phi_a17 --> -<g id="edge16" class="edge"> -<title>Return18->Phi_a17</title> -<path fill="none" stroke="black" d="M148.36,-124.3C143.69,-132.68 138,-142.9 132.87,-152.1"/> -<polygon fill="black" stroke="black" points="129.8,-150.42 127.99,-160.86 135.92,-153.82 129.8,-150.42"/> -<text text-anchor="middle" x="145.36" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="760" height="752" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 752" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M326,651 C326,675 380,678 380,702" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #18 · CTRL</title></path><path class="edge DATA" id="e7i1" d="M356,118 L356,128 L513,128 L513,291 L646,291 L646,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #4 · DATA</title></path><path class="edge DATA" id="e7i2" d="M676,118 L676,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[2] → #6 · DATA</title></path><path class="edge DATA" id="e9i1" d="M356,118 L356,128 L307,128 L307,225" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M84,118 L84,128 L226,128 L226,215 L337,215 L337,225" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #8 · DATA</title></path><path class="edge CTRL" id="e10i0" d="M236,118 L236,329" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #1 · CTRL</title></path><path class="edge DATA" id="e10i1" d="M307,281 L307,291 L316,291 L316,329" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path><path class="edge DATA" id="e15i1" d="M356,118 L356,128 L494,128 L494,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#15[1] → #4 · DATA</title></path><path class="edge DATA" id="e15i2" d="M524,118 L524,343.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#15[2] → #14 · DATA</title></path><path class="edge CTRL" id="e16i1" d="M216,429 L216,439 L306,439 L306,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e16i2" d="M336,429 L336,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[2] → #11 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M494,399.66666666666663 L494,439 L438,439 L438,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #15 · DATA</title></path><path class="edge DATA" id="e17i2" d="M646,399.66666666666663 L646,449 L478,449 L478,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[2] → #7 · DATA</title></path><path class="edge CTRL" id="e18i0" d="M306,533 L306,598" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#18[0] → #16 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M458,533 L458,560 L346,560 L346,598" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #17 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(344,702)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #18 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(156,379)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(616,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #2 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(586,349.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #6 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n8" data-id="8" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 #1 +Type not computed + +</title></g><g class="node" id="n9" data-id="9" transform="translate(247,231)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #8 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(156,335)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#10 If +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n11" data-id="11" transform="translate(276,379)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #11/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 False +Projection 1 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n14" data-id="14" transform="translate(464,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 #3 +Type not computed + +</title></g><g class="node" id="n15" data-id="15" transform="translate(434,349.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #14 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n16" data-id="16" transform="translate(246,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #11 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(398,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 φ_a +Type not computed + +[0] → #16 ASSOC +[1] → #15 DATA +[2] → #7 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #16</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(266,604)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 Return +Type not computed + +[0] → #16 CTRL +[1] → #17 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(144,171)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><title>If · 8 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #10"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph5.json b/chapter05/docs/05-graph5.json new file mode 100644 index 00000000..b9dc070b --- /dev/null +++ b/chapter05/docs/05-graph5.json @@ -0,0 +1,27 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph5.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, + {"id": 6, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, + {"id": 8, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 14, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 7, "role": "CTRL", "label": null}], "proj": null}, + {"id": 19, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 16, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 19, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 10, "par": 0, "nodes": [5, 7, 9, 10, 16, 19]} + ] +} diff --git a/chapter05/docs/05-graph5.svg b/chapter05/docs/05-graph5.svg index 4f6fa4bd..4d137bda 100644 --- a/chapter05/docs/05-graph5.svg +++ b/chapter05/docs/05-graph5.svg @@ -1,196 +1,122 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="314pt" height="564pt" - viewBox="0.00 0.00 314.00 564.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 560)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-560 310,-560 310,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-548 298,-548 298,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="97,-511 97,-536 178,-536 178,-511 97,-511"/> -<polygon fill="none" stroke="black" points="97,-511 97,-536 178,-536 178,-511 97,-511"/> -<text text-anchor="start" x="119" y="-519.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="97,-480 97,-511 178,-511 178,-480 97,-480"/> -<polygon fill="yellow" stroke="transparent" points="102,-485 102,-506 142,-506 142,-485 102,-485"/> -<polygon fill="none" stroke="black" points="102,-485 102,-506 142,-506 142,-485 102,-485"/> -<text text-anchor="start" x="105" y="-491.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="142,-485 142,-506 173,-506 173,-485 142,-485"/> -<text text-anchor="start" x="145" y="-491.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="148,-52 94,-52 94,-16 148,-16 148,-52"/> -<text text-anchor="middle" x="121" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return21 --> -<g id="node11" class="node"> -<title>Return21</title> -<polygon fill="yellow" stroke="black" points="154,-124 88,-124 88,-88 154,-88 154,-124"/> -<text text-anchor="middle" x="121" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return21 --> -<g id="edge1" class="edge"> -<title>Stop3->Return21</title> -<path fill="none" stroke="red" d="M121,-52.3C121,-60.02 121,-69.29 121,-77.89"/> -<polygon fill="red" stroke="red" points="117.5,-77.9 121,-87.9 124.5,-77.9 117.5,-77.9"/> -<text text-anchor="middle" x="118" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="263" cy="-336" rx="27" ry="18"/> -<text text-anchor="middle" x="263" y="-332.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_8 --> -<g id="node4" class="node"> -<title>Con_8</title> -<ellipse fill="none" stroke="black" cx="43" cy="-508" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-504.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode9 --> -<g id="node5" class="node"> -<title>EQNode9</title> -<ellipse fill="none" stroke="black" cx="71" cy="-422" rx="27" ry="18"/> -<text text-anchor="middle" x="71" y="-418.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode9->Start2 --> -<g id="edge2" class="edge"> -<title>EQNode9->Start2:p1</title> -<path fill="none" stroke="black" d="M92.51,-433.05C113.44,-443.41 143.59,-460.03 154.16,-474.46"/> -<polygon fill="black" stroke="black" points="151.02,-476.03 158,-484 157.51,-473.42 151.02,-476.03"/> -<text text-anchor="middle" x="89.51" y="-435.65" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode9->Con_8 --> -<g id="edge3" class="edge"> -<title>EQNode9->Con_8</title> -<path fill="none" stroke="black" d="M65.33,-440C61.44,-451.69 56.19,-467.44 51.76,-480.73"/> -<polygon fill="black" stroke="black" points="48.4,-479.72 48.56,-490.31 55.04,-481.93 48.4,-479.72"/> -<text text-anchor="middle" x="62.33" y="-442.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If10 --> -<g id="node6" class="node"> -<title>If10</title> -<polygon fill="yellow" stroke="transparent" points="24,-339 24,-364 118,-364 118,-339 24,-339"/> -<polygon fill="none" stroke="black" points="24,-339 24,-364 118,-364 118,-339 24,-339"/> -<text text-anchor="start" x="65.5" y="-347.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="24,-308 24,-339 118,-339 118,-308 24,-308"/> -<polygon fill="yellow" stroke="transparent" points="29,-313 29,-334 69,-334 69,-313 29,-313"/> -<polygon fill="none" stroke="black" points="29,-313 29,-334 69,-334 69,-313 29,-313"/> -<text text-anchor="start" x="32" y="-319.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="69,-313 69,-334 113,-334 113,-313 69,-313"/> -<polygon fill="none" stroke="black" points="69,-313 69,-334 113,-334 113,-313 69,-313"/> -<text text-anchor="start" x="72" y="-319.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If10->Start2 --> -<g id="edge4" class="edge"> -<title>If10->Start2:p0</title> -<path fill="none" stroke="red" d="M90.29,-368.12C96.41,-379.12 102.69,-391.8 107,-404 117.81,-434.65 121.3,-445.6 121.9,-473.74"/> -<polygon fill="red" stroke="red" points="118.4,-474.03 122,-484 125.4,-473.97 118.4,-474.03"/> -<text text-anchor="middle" x="87.29" y="-370.72" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If10->EQNode9 --> -<g id="edge5" class="edge"> -<title>If10->EQNode9</title> -<path fill="none" stroke="black" d="M71,-368.28C71,-376.58 71,-385.48 71,-393.56"/> -<polygon fill="black" stroke="black" points="67.5,-393.6 71,-403.6 74.5,-393.6 67.5,-393.6"/> -<text text-anchor="middle" x="68" y="-370.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_14 --> -<g id="node7" class="node"> -<title>Con_14</title> -<ellipse fill="none" stroke="black" cx="191" cy="-336" rx="27" ry="18"/> -<text text-anchor="middle" x="191" y="-332.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Region16 --> -<g id="node8" class="node"> -<title>Region16</title> -<polygon fill="yellow" stroke="black" points="125,-268 59,-268 59,-232 125,-232 125,-268"/> -<text text-anchor="middle" x="92" y="-246.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region16->If10 --> -<g id="edge6" class="edge"> -<title>Region16->If10:p0</title> -<path fill="none" stroke="red" d="M71.51,-268.03C62.68,-276.94 53.63,-288.71 50.32,-301.78"/> -<polygon fill="red" stroke="red" points="46.81,-301.63 49,-312 53.75,-302.53 46.81,-301.63"/> -<text text-anchor="middle" x="68.51" y="-270.63" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region16->If10 --> -<g id="edge7" class="edge"> -<title>Region16->If10:p1</title> -<path fill="none" stroke="red" d="M91.57,-268.09C91.36,-277.55 91.13,-289.77 91.04,-301.69"/> -<polygon fill="red" stroke="red" points="87.54,-301.99 91,-312 94.54,-302.01 87.54,-301.99"/> -<text text-anchor="middle" x="88.57" y="-270.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a19 --> -<g id="node9" class="node"> -<title>Phi_a19</title> -<ellipse fill="lightyellow" stroke="black" cx="191" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="191" y="-246.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a19->Con_6 --> -<g id="edge10" class="edge"> -<title>Phi_a19->Con_6</title> -<path fill="none" stroke="black" d="M203.87,-266.02C214.93,-278.92 231.04,-297.71 243.65,-312.42"/> -<polygon fill="black" stroke="black" points="241.07,-314.8 250.24,-320.11 246.39,-310.24 241.07,-314.8"/> -<text text-anchor="middle" x="200.87" y="-268.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a19->Con_14 --> -<g id="edge9" class="edge"> -<title>Phi_a19->Con_14</title> -<path fill="none" stroke="black" d="M191,-268.4C191,-279.74 191,-294.77 191,-307.68"/> -<polygon fill="black" stroke="black" points="187.5,-307.9 191,-317.9 194.5,-307.9 187.5,-307.9"/> -<text text-anchor="middle" x="188" y="-271" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a19->Region16 --> -<g id="edge8" class="edge"> -<title>Phi_a19->Region16</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M163.78,-250C154.35,-250 144.92,-250 135.49,-250"/> -<polygon fill="black" stroke="black" points="135.26,-246.5 125.26,-250 135.26,-253.5 135.26,-246.5"/> -<text text-anchor="middle" x="160.78" y="-243.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- EQNode20 --> -<g id="node10" class="node"> -<title>EQNode20</title> -<ellipse fill="none" stroke="black" cx="145" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="145" y="-174.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode20->Start2 --> -<g id="edge11" class="edge"> -<title>EQNode20->Start2:p1</title> -<path fill="none" stroke="black" d="M145.93,-196.36C148.75,-249.2 157.02,-408.5 157.92,-473.67"/> -<polygon fill="black" stroke="black" points="154.42,-474.03 158,-484 161.42,-473.97 154.42,-474.03"/> -<text text-anchor="middle" x="142.93" y="-198.96" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode20->Phi_a19 --> -<g id="edge12" class="edge"> -<title>EQNode20->Phi_a19</title> -<path fill="none" stroke="black" d="M155.44,-194.88C161.2,-203.66 168.48,-214.74 174.96,-224.58"/> -<polygon fill="black" stroke="black" points="172.19,-226.74 180.6,-233.18 178.04,-222.9 172.19,-226.74"/> -<text text-anchor="middle" x="152.44" y="-197.48" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return21->Region16 --> -<g id="edge13" class="edge"> -<title>Return21->Region16</title> -<path fill="none" stroke="red" d="M116.96,-124.15C114.56,-134.51 111.51,-147.99 109,-160 104.69,-180.66 100.23,-204.11 96.96,-221.75"/> -<polygon fill="red" stroke="red" points="93.46,-221.44 95.09,-231.9 100.34,-222.7 93.46,-221.44"/> -<text text-anchor="middle" x="113.96" y="-126.75" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return21->EQNode20 --> -<g id="edge14" class="edge"> -<title>Return21->EQNode20</title> -<path fill="none" stroke="black" d="M126.93,-124.3C129.68,-132.3 132.99,-141.98 136.03,-150.85"/> -<polygon fill="black" stroke="black" points="132.75,-152.05 139.3,-160.38 139.37,-149.78 132.75,-152.05"/> -<text text-anchor="middle" x="123.93" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="793" height="838" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 793 838" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(35,173)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M191,737 C191,761 396.5,764 396.5,788" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #21 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M247,118 L247,128 L207,128 L207,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M405,118 L405,138 L237,138 L237,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #8 · DATA</title></path><path class="edge CTRL" id="e10i0" d="M127,118 L127,311" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #1 · CTRL</title></path><path class="edge DATA" id="e10i1" d="M207,263 L207,311" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path><path class="edge CTRL" id="e16i1" d="M107,411 L107,421 L171,421 L171,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e16i2" d="M227,411 L227,421 L201,421 L201,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[2] → #7 · CTRL</title></path><path class="edge DATA" id="e19i1" d="M557,118 L557,148 L303,148 L303,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #14 · DATA</title></path><path class="edge DATA" id="e19i2" d="M709,118 L709,158 L343,158 L343,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[2] → #6 · DATA</title></path><path class="edge DATA" id="e20i1" d="M247,118 L247,128 L24,128 L24,542 L242,542 L242,580" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[1] → #4 · DATA</title></path><path class="edge DATA" id="e20i2" d="M323,515 L323,542 L272,542 L272,580" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[2] → #19 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M171,515 L171,684" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #16 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M242,636 L242,646 L211,646 L211,684" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #20 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(67,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(67,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(360.5,788)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #21 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(187,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(47,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(649,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #2 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(167,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #7/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 False +Projection 1 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(345,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 #1 +Type not computed + +</title></g><g class="node" id="n9" data-id="9" transform="translate(147,213)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #8 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(47,317)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#10 If +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n14" data-id="14" transform="translate(497,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 #3 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(111,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #7 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n19" data-id="19" transform="translate(263,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 φ_a +Type not computed + +[0] → #16 ASSOC +[1] → #14 DATA +[2] → #6 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #16</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n20" data-id="20" transform="translate(182,586)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #19 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n21" data-id="21" transform="translate(131,690)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Return +Type not computed + +[0] → #16 CTRL +[1] → #20 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(35,173)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #10"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph6.json b/chapter05/docs/05-graph6.json new file mode 100644 index 00000000..1039bb08 --- /dev/null +++ b/chapter05/docs/05-graph6.json @@ -0,0 +1,26 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph6.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, + {"id": 6, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, + {"id": 8, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "#4", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 7, "role": "CTRL", "label": null}], "proj": null}, + {"id": 17, "label": "φ_c", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 16, "role": "ASSOC", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 10, "par": 0, "nodes": [5, 7, 9, 10, 16, 17]} + ] +} diff --git a/chapter05/docs/05-graph6.svg b/chapter05/docs/05-graph6.svg index 71527d7f..831a6a07 100644 --- a/chapter05/docs/05-graph6.svg +++ b/chapter05/docs/05-graph6.svg @@ -1,176 +1,117 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="294pt" height="492pt" - viewBox="0.00 0.00 294.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-488 290,-488 290,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-476 278,-476 278,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="109,-439 109,-464 190,-464 190,-439 109,-439"/> -<polygon fill="none" stroke="black" points="109,-439 109,-464 190,-464 190,-439 109,-439"/> -<text text-anchor="start" x="131" y="-447.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="109,-408 109,-439 190,-439 190,-408 109,-408"/> -<polygon fill="yellow" stroke="transparent" points="114,-413 114,-434 154,-434 154,-413 114,-413"/> -<polygon fill="none" stroke="black" points="114,-413 114,-434 154,-434 154,-413 114,-413"/> -<text text-anchor="start" x="117" y="-419.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="154,-413 154,-434 185,-434 185,-413 154,-413"/> -<text text-anchor="start" x="157" y="-419.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="181,-52 127,-52 127,-16 181,-16 181,-52"/> -<text text-anchor="middle" x="154" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return19 --> -<g id="node10" class="node"> -<title>Return19</title> -<polygon fill="yellow" stroke="black" points="187,-124 121,-124 121,-88 187,-88 187,-124"/> -<text text-anchor="middle" x="154" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return19 --> -<g id="edge1" class="edge"> -<title>Stop3->Return19</title> -<path fill="none" stroke="red" d="M154,-52.3C154,-60.02 154,-69.29 154,-77.89"/> -<polygon fill="red" stroke="red" points="150.5,-77.9 154,-87.9 157.5,-77.9 150.5,-77.9"/> -<text text-anchor="middle" x="151" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="43" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-260.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Con_8 --> -<g id="node4" class="node"> -<title>Con_8</title> -<ellipse fill="none" stroke="black" cx="243" cy="-436" rx="27" ry="18"/> -<text text-anchor="middle" x="243" y="-432.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode9 --> -<g id="node5" class="node"> -<title>EQNode9</title> -<ellipse fill="none" stroke="black" cx="215" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="215" y="-346.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode9->Start2 --> -<g id="edge2" class="edge"> -<title>EQNode9->Start2:p1</title> -<path fill="none" stroke="black" d="M197.73,-364.01C187.32,-373.17 175.33,-386.49 171.36,-401.73"/> -<polygon fill="black" stroke="black" points="167.84,-401.63 170,-412 174.78,-402.54 167.84,-401.63"/> -<text text-anchor="middle" x="194.73" y="-366.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode9->Con_8 --> -<g id="edge3" class="edge"> -<title>EQNode9->Con_8</title> -<path fill="none" stroke="black" d="M220.67,-368C224.56,-379.69 229.81,-395.44 234.24,-408.73"/> -<polygon fill="black" stroke="black" points="230.96,-409.93 237.44,-418.31 237.6,-407.72 230.96,-409.93"/> -<text text-anchor="middle" x="217.67" y="-370.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If10 --> -<g id="node6" class="node"> -<title>If10</title> -<polygon fill="yellow" stroke="transparent" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<polygon fill="none" stroke="black" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<text text-anchor="start" x="209.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="168,-236 168,-267 262,-267 262,-236 168,-236"/> -<polygon fill="yellow" stroke="transparent" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<polygon fill="none" stroke="black" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<text text-anchor="start" x="176" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<polygon fill="none" stroke="black" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<text text-anchor="start" x="216" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If10->Start2 --> -<g id="edge4" class="edge"> -<title>If10->Start2:p0</title> -<path fill="none" stroke="red" d="M185.76,-296.14C164.32,-322.05 138.32,-361.17 134.48,-401.9"/> -<polygon fill="red" stroke="red" points="130.98,-401.84 134,-412 137.97,-402.18 130.98,-401.84"/> -<text text-anchor="middle" x="182.76" y="-298.74" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If10->EQNode9 --> -<g id="edge5" class="edge"> -<title>If10->EQNode9</title> -<path fill="none" stroke="black" d="M215,-296.28C215,-304.58 215,-313.48 215,-321.56"/> -<polygon fill="black" stroke="black" points="211.5,-321.6 215,-331.6 218.5,-321.6 211.5,-321.6"/> -<text text-anchor="middle" x="212" y="-298.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node7" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="115" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-260.3" font-family="Times,serif" font-size="14.00">#4</text> -</g> -<!-- Region16 --> -<g id="node8" class="node"> -<title>Region16</title> -<polygon fill="yellow" stroke="black" points="226,-196 160,-196 160,-160 226,-160 226,-196"/> -<text text-anchor="middle" x="193" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region16->If10 --> -<g id="edge6" class="edge"> -<title>Region16->If10:p0</title> -<path fill="none" stroke="red" d="M193,-196.09C193,-205.55 193,-217.77 193,-229.69"/> -<polygon fill="red" stroke="red" points="189.5,-230 193,-240 196.5,-230 189.5,-230"/> -<text text-anchor="middle" x="190" y="-198.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region16->If10 --> -<g id="edge7" class="edge"> -<title>Region16->If10:p1</title> -<path fill="none" stroke="red" d="M213.02,-196.12C221.64,-205.06 230.48,-216.84 233.71,-229.84"/> -<polygon fill="red" stroke="red" points="230.27,-230.52 235,-240 237.22,-229.64 230.27,-230.52"/> -<text text-anchor="middle" x="210.02" y="-198.72" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_c17 --> -<g id="node9" class="node"> -<title>Phi_c17</title> -<ellipse fill="lightyellow" stroke="black" cx="115" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-174.3" font-family="Times,serif" font-size="14.00">φ_c</text> -</g> -<!-- Phi_c17->Con_6 --> -<g id="edge10" class="edge"> -<title>Phi_c17->Con_6</title> -<path fill="none" stroke="black" d="M102.13,-194.02C91.07,-206.92 74.96,-225.71 62.35,-240.42"/> -<polygon fill="black" stroke="black" points="59.61,-238.24 55.76,-248.11 64.93,-242.8 59.61,-238.24"/> -<text text-anchor="middle" x="99.13" y="-196.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_c17->Con_15 --> -<g id="edge9" class="edge"> -<title>Phi_c17->Con_15</title> -<path fill="none" stroke="black" d="M115,-196.4C115,-207.74 115,-222.77 115,-235.68"/> -<polygon fill="black" stroke="black" points="111.5,-235.9 115,-245.9 118.5,-235.9 111.5,-235.9"/> -<text text-anchor="middle" x="112" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_c17->Region16 --> -<g id="edge8" class="edge"> -<title>Phi_c17->Region16</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M142.12,-178C144.58,-178 147.04,-178 149.5,-178"/> -<polygon fill="black" stroke="black" points="149.61,-181.5 159.61,-178 149.61,-174.5 149.61,-181.5"/> -<text text-anchor="middle" x="145.12" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return19->Region16 --> -<g id="edge11" class="edge"> -<title>Return19->Region16</title> -<path fill="none" stroke="red" d="M163.64,-124.3C168.13,-132.36 173.56,-142.11 178.52,-151.02"/> -<polygon fill="red" stroke="red" points="175.55,-152.86 183.47,-159.9 181.66,-149.46 175.55,-152.86"/> -<text text-anchor="middle" x="160.64" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return19->Phi_c17 --> -<g id="edge12" class="edge"> -<title>Return19->Phi_c17</title> -<path fill="none" stroke="black" d="M144.36,-124.3C139.69,-132.68 134,-142.9 128.87,-152.1"/> -<polygon fill="black" stroke="black" points="125.8,-150.42 123.99,-160.86 131.92,-153.82 125.8,-150.42"/> -<text text-anchor="middle" x="141.36" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="782" height="734" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 782 734" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,633 C180,657 391,660 391,684" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #19 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M236,118 L236,128 L196,128 L196,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M394,118 L394,138 L226,138 L226,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #8 · DATA</title></path><path class="edge CTRL" id="e10i0" d="M116,118 L116,311" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #1 · CTRL</title></path><path class="edge DATA" id="e10i1" d="M196,263 L196,311" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path><path class="edge CTRL" id="e16i1" d="M96,411 L96,421 L160,421 L160,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e16i2" d="M216,411 L216,421 L190,421 L190,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[2] → #7 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M546,118 L546,148 L292,148 L292,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #15 · DATA</title></path><path class="edge DATA" id="e17i2" d="M698,118 L698,158 L332,158 L332,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[2] → #6 · DATA</title></path><path class="edge CTRL" id="e19i0" d="M160,515 L160,580" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[0] → #16 · CTRL</title></path><path class="edge DATA" id="e19i1" d="M312,515 L312,542 L200,542 L200,580" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #17 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(56,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(56,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(355,684)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #19 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(36,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(638,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #3 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(156,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #7/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 False +Projection 1 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(334,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 #1 +Type not computed + +</title></g><g class="node" id="n9" data-id="9" transform="translate(136,213)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #8 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(36,317)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#10 If +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n15" data-id="15" transform="translate(486,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#4</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 #4 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(100,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #7 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(252,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_c</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 φ_c +Type not computed + +[0] → #16 ASSOC +[1] → #15 DATA +[2] → #6 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #16</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n19" data-id="19" transform="translate(120,586)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 Return +Type not computed + +[0] → #16 CTRL +[1] → #17 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,173)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #10"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph7.json b/chapter05/docs/05-graph7.json new file mode 100644 index 00000000..df6cf547 --- /dev/null +++ b/chapter05/docs/05-graph7.json @@ -0,0 +1,31 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph7.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 51, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 1}}, + {"id": 10, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 11, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 20, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 19, "role": "DATA", "label": null}], "proj": null}, + {"id": 31, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 6, "role": "CTRL", "label": null}], "proj": null}, + {"id": 37, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 31, "role": "ASSOC", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 42, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 37, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 46, "label": "#4", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 48, "label": "#5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 49, "label": "φ_ab", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 31, "role": "ASSOC", "label": null}, {"idx": 1, "def": 46, "role": "DATA", "label": null}, {"idx": 2, "def": 48, "role": "DATA", "label": null}], "proj": null}, + {"id": 50, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 42, "role": "DATA", "label": null}, {"idx": 2, "def": 49, "role": "DATA", "label": null}], "proj": null}, + {"id": 51, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 31, "role": "CTRL", "label": null}, {"idx": 1, "def": 50, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 12, "par": 0, "nodes": [5, 6, 11, 12, 20, 31, 37, 49]} + ] +} diff --git a/chapter05/docs/05-graph7.svg b/chapter05/docs/05-graph7.svg index 8ba5ebd6..4ef44b41 100644 --- a/chapter05/docs/05-graph7.svg +++ b/chapter05/docs/05-graph7.svg @@ -1,269 +1,140 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="386pt" height="636pt" - viewBox="0.00 0.00 386.00 636.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 632)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-632 382,-632 382,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-620 370,-620 370,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="187,-583 187,-608 268,-608 268,-583 187,-583"/> -<polygon fill="none" stroke="black" points="187,-583 187,-608 268,-608 268,-583 187,-583"/> -<text text-anchor="start" x="209" y="-591.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="187,-552 187,-583 268,-583 268,-552 187,-552"/> -<polygon fill="yellow" stroke="transparent" points="192,-557 192,-578 232,-578 232,-557 192,-557"/> -<polygon fill="none" stroke="black" points="192,-557 192,-578 232,-578 232,-557 192,-557"/> -<text text-anchor="start" x="195" y="-563.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="232,-557 232,-578 263,-578 263,-557 232,-557"/> -<text text-anchor="start" x="235" y="-563.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="230,-52 176,-52 176,-16 230,-16 230,-52"/> -<text text-anchor="middle" x="203" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return51 --> -<g id="node13" class="node"> -<title>Return51</title> -<polygon fill="yellow" stroke="black" points="236,-124 170,-124 170,-88 236,-88 236,-124"/> -<text text-anchor="middle" x="203" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return51 --> -<g id="edge1" class="edge"> -<title>Stop3->Return51</title> -<path fill="none" stroke="red" d="M203,-52.3C203,-60.02 203,-69.29 203,-77.89"/> -<polygon fill="red" stroke="red" points="199.5,-77.9 203,-87.9 206.5,-77.9 199.5,-77.9"/> -<text text-anchor="middle" x="200" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_b37 --> -<g id="node3" class="node"> -<title>Phi_b37</title> -<ellipse fill="lightyellow" stroke="black" cx="63" cy="-322" rx="27.1" ry="18"/> -<text text-anchor="middle" x="63" y="-318.3" font-family="Times,serif" font-size="14.00">φ_b</text> -</g> -<!-- Phi_b37->Start2 --> -<g id="edge4" class="edge"> -<title>Phi_b37->Start2:p1</title> -<path fill="none" stroke="black" d="M50.14,-338.15C37.78,-354.08 20.49,-380.46 17,-407"/> -<text text-anchor="middle" x="47.14" y="-340.75" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Mul20 --> -<g id="node14" class="node"> -<title>Mul20</title> -<ellipse fill="none" stroke="black" cx="63" cy="-408" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-404.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Phi_b37->Mul20 --> -<g id="edge3" class="edge"> -<title>Phi_b37->Mul20</title> -<path fill="none" stroke="black" d="M63,-340.4C63,-351.74 63,-366.77 63,-379.68"/> -<polygon fill="black" stroke="black" points="59.5,-379.9 63,-389.9 66.5,-379.9 59.5,-379.9"/> -<text text-anchor="middle" x="60" y="-343" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region31 --> -<g id="node15" class="node"> -<title>Region31</title> -<polygon fill="yellow" stroke="black" points="287,-340 221,-340 221,-304 287,-304 287,-340"/> -<text text-anchor="middle" x="254" y="-318.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Phi_b37->Region31 --> -<g id="edge2" class="edge"> -<title>Phi_b37->Region31</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M83.07,-309.47C97.9,-300.98 118.92,-290.52 139,-286 166.75,-279.76 175.89,-277.4 203,-286 210.99,-288.54 218.81,-292.83 225.83,-297.58"/> -<polygon fill="black" stroke="black" points="224.11,-300.66 234.24,-303.75 228.25,-295.01 224.11,-300.66"/> -<text text-anchor="middle" x="80.07" y="-303.07" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_10 --> -<g id="node4" class="node"> -<title>Con_10</title> -<ellipse fill="none" stroke="black" cx="321" cy="-580" rx="27" ry="18"/> -<text text-anchor="middle" x="321" y="-576.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Add42 --> -<g id="node5" class="node"> -<title>Add42</title> -<ellipse fill="none" stroke="black" cx="63" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-246.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add42->Start2 --> -<g id="edge6" class="edge"> -<title>Add42->Start2:p1</title> -<path fill="none" stroke="black" d="M49.72,-266.09C41.69,-276.12 32.07,-289.98 27,-304 11.37,-347.26 22.99,-361.4 17,-407"/> -<path fill="none" stroke="black" d="M17,-409C11.54,-445.93 0.41,-459.55 17,-493"/> -<path fill="none" stroke="black" d="M17,-495C20.89,-502.85 19.85,-506.92 27,-512 102.92,-565.95 228.75,-471 246.01,-537.97"/> -<polygon fill="black" stroke="black" points="242.59,-538.7 247.67,-548 249.49,-537.56 242.59,-538.7"/> -<text text-anchor="middle" x="46.72" y="-268.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add42->Phi_b37 --> -<g id="edge5" class="edge"> -<title>Add42->Phi_b37</title> -<path fill="none" stroke="black" d="M63,-268.3C63,-276.02 63,-285.29 63,-293.89"/> -<polygon fill="black" stroke="black" points="59.5,-293.9 63,-303.9 66.5,-293.9 59.5,-293.9"/> -<text text-anchor="middle" x="60" y="-270.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode11 --> -<g id="node6" class="node"> -<title>EQNode11</title> -<ellipse fill="none" stroke="black" cx="307" cy="-494" rx="27" ry="18"/> -<text text-anchor="middle" x="307" y="-490.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode11->Start2 --> -<g id="edge7" class="edge"> -<title>EQNode11->Start2:p1</title> -<path fill="none" stroke="black" d="M300.78,-511.7C294.25,-528.15 283.48,-552.23 273.01,-562.3"/> -<polygon fill="black" stroke="black" points="271.25,-559.27 264,-567 274.49,-565.48 271.25,-559.27"/> -<text text-anchor="middle" x="297.78" y="-514.3" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode11->Con_10 --> -<g id="edge8" class="edge"> -<title>EQNode11->Con_10</title> -<path fill="none" stroke="black" d="M309.83,-512C311.75,-523.5 314.32,-538.93 316.51,-552.08"/> -<polygon fill="black" stroke="black" points="313.07,-552.74 318.17,-562.03 319.98,-551.59 313.07,-552.74"/> -<text text-anchor="middle" x="306.83" y="-514.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If12 --> -<g id="node7" class="node"> -<title>If12</title> -<polygon fill="yellow" stroke="transparent" points="260,-411 260,-436 354,-436 354,-411 260,-411"/> -<polygon fill="none" stroke="black" points="260,-411 260,-436 354,-436 354,-411 260,-411"/> -<text text-anchor="start" x="301.5" y="-419.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="260,-380 260,-411 354,-411 354,-380 260,-380"/> -<polygon fill="yellow" stroke="transparent" points="265,-385 265,-406 305,-406 305,-385 265,-385"/> -<polygon fill="none" stroke="black" points="265,-385 265,-406 305,-406 305,-385 265,-385"/> -<text text-anchor="start" x="268" y="-391.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="305,-385 305,-406 349,-406 349,-385 305,-385"/> -<polygon fill="none" stroke="black" points="305,-385 305,-406 349,-406 349,-385 305,-385"/> -<text text-anchor="start" x="308" y="-391.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If12->Start2 --> -<g id="edge9" class="edge"> -<title>If12->Start2:p0</title> -<path fill="none" stroke="red" d="M271.9,-440.02C246.84,-465.46 216.84,-504 212.53,-545.87"/> -<polygon fill="red" stroke="red" points="209.02,-545.83 212,-556 216.01,-546.2 209.02,-545.83"/> -<text text-anchor="middle" x="268.9" y="-442.62" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If12->EQNode11 --> -<g id="edge10" class="edge"> -<title>If12->EQNode11</title> -<path fill="none" stroke="black" d="M307,-440.28C307,-448.58 307,-457.48 307,-465.56"/> -<polygon fill="black" stroke="black" points="303.5,-465.6 307,-475.6 310.5,-465.6 303.5,-465.6"/> -<text text-anchor="middle" x="304" y="-442.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_46 --> -<g id="node8" class="node"> -<title>Con_46</title> -<ellipse fill="none" stroke="black" cx="135" cy="-408" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-404.3" font-family="Times,serif" font-size="14.00">#4</text> -</g> -<!-- Con_48 --> -<g id="node9" class="node"> -<title>Con_48</title> -<ellipse fill="none" stroke="black" cx="207" cy="-408" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-404.3" font-family="Times,serif" font-size="14.00">#5</text> -</g> -<!-- Phi_ab49 --> -<g id="node10" class="node"> -<title>Phi_ab49</title> -<ellipse fill="lightyellow" stroke="black" cx="171" cy="-322" rx="32.49" ry="18"/> -<text text-anchor="middle" x="171" y="-318.3" font-family="Times,serif" font-size="14.00">φ_ab</text> -</g> -<!-- Phi_ab49->Con_46 --> -<g id="edge12" class="edge"> -<title>Phi_ab49->Con_46</title> -<path fill="none" stroke="black" d="M163.89,-339.6C158.81,-351.45 151.88,-367.62 146.08,-381.15"/> -<polygon fill="black" stroke="black" points="142.82,-379.87 142.1,-390.44 149.25,-382.63 142.82,-379.87"/> -<text text-anchor="middle" x="160.89" y="-342.2" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_ab49->Con_48 --> -<g id="edge13" class="edge"> -<title>Phi_ab49->Con_48</title> -<path fill="none" stroke="black" d="M178.11,-339.6C183.19,-351.45 190.12,-367.62 195.92,-381.15"/> -<polygon fill="black" stroke="black" points="192.75,-382.63 199.9,-390.44 199.18,-379.87 192.75,-382.63"/> -<text text-anchor="middle" x="175.11" y="-342.2" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_ab49->Region31 --> -<g id="edge11" class="edge"> -<title>Phi_ab49->Region31</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M203.75,-322C206.03,-322 208.32,-322 210.6,-322"/> -<polygon fill="black" stroke="black" points="210.63,-325.5 220.63,-322 210.63,-318.5 210.63,-325.5"/> -<text text-anchor="middle" x="206.75" y="-315.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add50 --> -<g id="node11" class="node"> -<title>Add50</title> -<ellipse fill="none" stroke="black" cx="171" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="171" y="-174.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add50->Add42 --> -<g id="edge14" class="edge"> -<title>Add50->Add42</title> -<path fill="none" stroke="black" d="M152.19,-191.19C135,-202.33 109.38,-218.94 90.01,-231.5"/> -<polygon fill="black" stroke="black" points="88.08,-228.57 81.6,-236.95 91.89,-234.44 88.08,-228.57"/> -<text text-anchor="middle" x="149.19" y="-193.79" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add50->Phi_ab49 --> -<g id="edge15" class="edge"> -<title>Add50->Phi_ab49</title> -<path fill="none" stroke="black" d="M171,-196.13C171,-220.33 171,-264.79 171,-293.61"/> -<polygon fill="black" stroke="black" points="167.5,-293.81 171,-303.81 174.5,-293.81 167.5,-293.81"/> -<text text-anchor="middle" x="168" y="-198.73" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_19 --> -<g id="node12" class="node"> -<title>Con_19</title> -<ellipse fill="none" stroke="black" cx="63" cy="-494" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-490.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Return51->Add50 --> -<g id="edge17" class="edge"> -<title>Return51->Add50</title> -<path fill="none" stroke="black" d="M195.09,-124.3C191.39,-132.39 186.91,-142.19 182.83,-151.13"/> -<polygon fill="black" stroke="black" points="179.57,-149.83 178.6,-160.38 185.94,-152.74 179.57,-149.83"/> -<text text-anchor="middle" x="192.09" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return51->Region31 --> -<g id="edge16" class="edge"> -<title>Return51->Region31</title> -<path fill="none" stroke="red" d="M207.09,-124.15C215.93,-161.25 236.89,-249.19 247.54,-293.9"/> -<polygon fill="red" stroke="red" points="244.17,-294.85 249.89,-303.77 250.98,-293.23 244.17,-294.85"/> -<text text-anchor="middle" x="204.09" y="-126.75" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Mul20->Start2 --> -<g id="edge18" class="edge"> -<title>Mul20->Start2:p1</title> -<path fill="none" stroke="black" d="M46.66,-422.5C28.85,-438.94 4.44,-467.68 17,-493"/> -<text text-anchor="middle" x="43.66" y="-425.1" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Mul20->Con_19 --> -<g id="edge19" class="edge"> -<title>Mul20->Con_19</title> -<path fill="none" stroke="black" d="M63,-426.4C63,-437.74 63,-452.77 63,-465.68"/> -<polygon fill="black" stroke="black" points="59.5,-465.9 63,-475.9 66.5,-465.9 59.5,-465.9"/> -<text text-anchor="middle" x="60" y="-429" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region31->If12 --> -<g id="edge20" class="edge"> -<title>Region31->If12:p0</title> -<path fill="none" stroke="red" d="M268.23,-340.25C274.66,-349.42 281.38,-361.37 283.93,-373.89"/> -<polygon fill="red" stroke="red" points="280.47,-374.42 285,-384 287.43,-373.69 280.47,-374.42"/> -<text text-anchor="middle" x="265.23" y="-342.85" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region31->If12 --> -<g id="edge21" class="edge"> -<title>Region31->If12:p1</title> -<path fill="none" stroke="red" d="M287.08,-335.84C303.38,-344.18 320.59,-356.74 325.57,-373.96"/> -<polygon fill="red" stroke="red" points="322.13,-374.59 327,-384 329.06,-373.61 322.13,-374.59"/> -<text text-anchor="middle" x="290.08" y="-329.44" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="902" height="942" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 902 942" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,173)"><rect class="region-box" rx="8" width="538" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M326,841 C326,865 451,868 451,892" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #51 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M356,118 L356,148 L316,148 L316,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #4 · DATA</title></path><path class="edge DATA" id="e11i2" d="M84,118 L84,158 L346,158 L346,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[2] → #10 · DATA</title></path><path class="edge CTRL" id="e12i0" d="M236,118 L236,311" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #1 · CTRL</title></path><path class="edge DATA" id="e12i1" d="M316,263 L316,311" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #11 · DATA</title></path><path class="edge DATA" id="e20i1" d="M356,118 L356,148 L494,148 L494,325.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[1] → #4 · DATA</title></path><path class="edge DATA" id="e20i2" d="M514,118 L514,128 L524,128 L524,325.66666666666663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[2] → #19 · DATA</title></path><path class="edge CTRL" id="e31i1" d="M216,411 L216,421 L306,421 L306,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e31i2" d="M336,411 L336,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[2] → #6 · CTRL</title></path><path class="edge DATA" id="e37i1" d="M494,381.66666666666663 L494,421 L438,421 L438,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[1] → #20 · DATA</title></path><path class="edge DATA" id="e37i2" d="M356,118 L356,148 L564,148 L564,431 L478,431 L478,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[2] → #4 · DATA</title></path><path class="edge DATA" id="e42i1" d="M458,515 L458,542 L540,542 L540,580" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#42[1] → #37 · DATA</title></path><path class="edge DATA" id="e42i2" d="M356,118 L356,148 L692,148 L692,542 L570,542 L570,580" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#42[2] → #4 · DATA</title></path><path class="edge DATA" id="e49i1" d="M666,118 L666,128 L590,128 L590,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#49[1] → #46 · DATA</title></path><path class="edge DATA" id="e49i2" d="M818,118 L818,138 L630,138 L630,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#49[2] → #48 · DATA</title></path><path class="edge DATA" id="e50i1" d="M540,636 L540,684" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#50[1] → #42 · DATA</title></path><path class="edge DATA" id="e50i2" d="M610,515 L610,646 L570,646 L570,684" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#50[2] → #49 · DATA</title></path><path class="edge CTRL" id="e51i0" d="M306,515 L306,788" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#51[0] → #31 · CTRL</title></path><path class="edge DATA" id="e51i1" d="M540,740 L540,750 L346,750 L346,788" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#51[1] → #50 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(415,892)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #51 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(156,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #12 +Type not computed + +[0] → #12 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(276,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #12 +Type not computed + +[0] → #12 CTRL</title></g><g class="node" id="n10" data-id="10" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 #1 +Type not computed + +</title></g><g class="node" id="n11" data-id="11" transform="translate(256,213)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #10 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(156,317)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#12 If +Type not computed + +[0] → #1 CTRL +[1] → #11 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n19" data-id="19" transform="translate(454,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 #2 +Type not computed + +</title></g><g class="node" id="n20" data-id="20" transform="translate(434,331.66666666666663)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 * +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #19 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n31" data-id="31" transform="translate(246,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #31</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#31 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #6 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n37" data-id="37" transform="translate(398,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_b</tspan><tspan class="node-id">  #37</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#37 φ_b +Type not computed + +[0] → #31 ASSOC +[1] → #20 DATA +[2] → #4 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #31</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n42" data-id="42" transform="translate(480,586)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #42</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#42 + +Type not computed + +[0] → — DATA +[1] → #37 DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n46" data-id="46" transform="translate(606,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#4</tspan><tspan class="node-id">  #46</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#46 #4 +Type not computed + +</title></g><g class="node" id="n48" data-id="48" transform="translate(758,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #48</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#48 #5 +Type not computed + +</title></g><g class="node" id="n49" data-id="49" transform="translate(550,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_ab</tspan><tspan class="node-id">  #49</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#49 φ_ab +Type not computed + +[0] → #31 ASSOC +[1] → #46 DATA +[2] → #48 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #31</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n50" data-id="50" transform="translate(480,690)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #50</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#50 + +Type not computed + +[0] → — DATA +[1] → #42 DATA +[2] → #49 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n51" data-id="51" transform="translate(266,794)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #51</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#51 Return +Type not computed + +[0] → #31 CTRL +[1] → #50 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(144,173)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #12</tspan></text><title>If · 8 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #12"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph8.json b/chapter05/docs/05-graph8.json new file mode 100644 index 00000000..887d1e8a --- /dev/null +++ b/chapter05/docs/05-graph8.json @@ -0,0 +1,45 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph8.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": "0: $ctrl"}, {"idx": 1, "def": 6, "role": "ASSOC", "label": "0: arg"}, {"idx": 2, "def": 34, "role": "ASSOC", "label": "1: a"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 35, "role": "CTRL", "label": null}], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 0}}, + {"id": 11, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": {"par": 9, "idx": 1}}, + {"id": 12, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}], "proj": {"par": 15, "idx": 0}}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}], "proj": {"par": 15, "idx": 1}}, + {"id": 17, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 0}}, + {"id": 18, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 1}}, + {"id": 19, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 20, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 21, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "CTRL", "label": null}, {"idx": 2, "def": 16, "role": "CTRL", "label": null}], "proj": null}, + {"id": 22, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 21, "role": "ASSOC", "label": null}, {"idx": 1, "def": 19, "role": "DATA", "label": null}, {"idx": 2, "def": 20, "role": "DATA", "label": null}], "proj": null}, + {"id": 23, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 24, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 23, "role": "DATA", "label": null}], "proj": null}, + {"id": 25, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 24, "role": "DATA", "label": null}], "proj": null}, + {"id": 29, "label": "#4", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 30, "label": "#5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 31, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 17, "role": "CTRL", "label": null}, {"idx": 2, "def": 18, "role": "CTRL", "label": null}], "proj": null}, + {"id": 32, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 31, "role": "ASSOC", "label": null}, {"idx": 1, "def": 29, "role": "DATA", "label": null}, {"idx": 2, "def": 30, "role": "DATA", "label": null}], "proj": null}, + {"id": 33, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 21, "role": "CTRL", "label": null}, {"idx": 2, "def": 31, "role": "CTRL", "label": null}], "proj": null}, + {"id": 34, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 33, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "DATA", "label": null}, {"idx": 2, "def": 32, "role": "DATA", "label": null}], "proj": null}, + {"id": 35, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 33, "role": "CTRL", "label": null}, {"idx": 1, "def": 34, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 9, "par": 0, "nodes": [8, 9, 10, 11, 33, 34]}, + {"id": 15, "par": 9, "nodes": [12, 14, 15, 16, 21, 22]}, + {"id": 25, "par": 9, "nodes": [17, 18, 24, 25, 31, 32]} + ] +} diff --git a/chapter05/docs/05-graph8.svg b/chapter05/docs/05-graph8.svg index e5310db4..bf0f8aa0 100644 --- a/chapter05/docs/05-graph8.svg +++ b/chapter05/docs/05-graph8.svg @@ -1,430 +1,188 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="774pt" height="664pt" - viewBox="0.00 0.00 774.00 664.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 660)"> -<title>chapter05</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-660 770,-660 770,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-648 550,-648 550,-8 8,-8"/> -</g> -<g id="clust5" class="cluster"> -<title>cluster_Scope1_0</title> -<polygon fill="none" stroke="black" points="558,-72 558,-140 758,-140 758,-72 558,-72"/> -</g> -<g id="clust6" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="566,-80 566,-132 636,-132 636,-80 566,-80"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="190,-611 190,-636 271,-636 271,-611 190,-611"/> -<polygon fill="none" stroke="black" points="190,-611 190,-636 271,-636 271,-611 190,-611"/> -<text text-anchor="start" x="212" y="-619.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="190,-580 190,-611 271,-611 271,-580 190,-580"/> -<polygon fill="yellow" stroke="transparent" points="195,-585 195,-606 235,-606 235,-585 195,-585"/> -<polygon fill="none" stroke="black" points="195,-585 195,-606 235,-606 235,-585 195,-585"/> -<text text-anchor="start" x="198" y="-591.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="235,-585 235,-606 266,-606 266,-585 235,-585"/> -<text text-anchor="start" x="238" y="-591.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="286,-52 232,-52 232,-16 286,-16 286,-52"/> -<text text-anchor="middle" x="259" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return35 --> -<g id="node22" class="node"> -<title>Return35</title> -<polygon fill="yellow" stroke="black" points="292,-124 226,-124 226,-88 292,-88 292,-124"/> -<text text-anchor="middle" x="259" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return35 --> -<g id="edge1" class="edge"> -<title>Stop3->Return35</title> -<path fill="none" stroke="red" d="M259,-52.3C259,-60.02 259,-69.29 259,-77.89"/> -<polygon fill="red" stroke="red" points="255.5,-77.9 259,-87.9 262.5,-77.9 255.5,-77.9"/> -<text text-anchor="middle" x="256" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_7 --> -<g id="node3" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="136" cy="-608" rx="27" ry="18"/> -<text text-anchor="middle" x="136" y="-604.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- EQNode8 --> -<g id="node4" class="node"> -<title>EQNode8</title> -<ellipse fill="none" stroke="black" cx="169" cy="-522" rx="27" ry="18"/> -<text text-anchor="middle" x="169" y="-518.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode8->Start2 --> -<g id="edge2" class="edge"> -<title>EQNode8->Start2:p1</title> -<path fill="none" stroke="black" d="M190.12,-533.69C209.67,-544.17 237.18,-560.54 247.18,-574.44"/> -<polygon fill="black" stroke="black" points="244.04,-576.01 251,-584 250.54,-573.42 244.04,-576.01"/> -<text text-anchor="middle" x="187.12" y="-536.29" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode8->Con_7 --> -<g id="edge3" class="edge"> -<title>EQNode8->Con_7</title> -<path fill="none" stroke="black" d="M162.48,-539.6C157.87,-551.33 151.59,-567.3 146.31,-580.76"/> -<polygon fill="black" stroke="black" points="142.91,-579.85 142.51,-590.44 149.42,-582.41 142.91,-579.85"/> -<text text-anchor="middle" x="159.48" y="-542.2" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If9 --> -<g id="node5" class="node"> -<title>If9</title> -<polygon fill="yellow" stroke="transparent" points="124,-439 124,-464 218,-464 218,-439 124,-439"/> -<polygon fill="none" stroke="black" points="124,-439 124,-464 218,-464 218,-439 124,-439"/> -<text text-anchor="start" x="165.5" y="-447.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="124,-408 124,-439 218,-439 218,-408 124,-408"/> -<polygon fill="yellow" stroke="transparent" points="129,-413 129,-434 169,-434 169,-413 129,-413"/> -<polygon fill="none" stroke="black" points="129,-413 129,-434 169,-434 169,-413 129,-413"/> -<text text-anchor="start" x="132" y="-419.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="169,-413 169,-434 213,-434 213,-413 169,-413"/> -<polygon fill="none" stroke="black" points="169,-413 169,-434 213,-434 213,-413 169,-413"/> -<text text-anchor="start" x="172" y="-419.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If9->Start2 --> -<g id="edge4" class="edge"> -<title>If9->Start2:p0</title> -<path fill="none" stroke="red" d="M189.59,-468.09C195.4,-479.09 201.26,-491.78 205,-504 214.42,-534.78 214.99,-545.9 215,-573.83"/> -<polygon fill="red" stroke="red" points="211.5,-574 215,-584 218.5,-574 211.5,-574"/> -<text text-anchor="middle" x="186.59" y="-470.69" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If9->EQNode8 --> -<g id="edge5" class="edge"> -<title>If9->EQNode8</title> -<path fill="none" stroke="black" d="M170.26,-468.28C170.06,-476.58 169.85,-485.48 169.65,-493.56"/> -<polygon fill="black" stroke="black" points="166.15,-493.51 169.41,-503.6 173.15,-493.68 166.15,-493.51"/> -<text text-anchor="middle" x="167.26" y="-470.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_13 --> -<g id="node6" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="71" cy="-522" rx="27" ry="18"/> -<text text-anchor="middle" x="71" y="-518.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- EQNode14 --> -<g id="node7" class="node"> -<title>EQNode14</title> -<ellipse fill="none" stroke="black" cx="71" cy="-436" rx="27" ry="18"/> -<text text-anchor="middle" x="71" y="-432.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode14->Start2 --> -<g id="edge6" class="edge"> -<title>EQNode14->Start2:p1</title> -<path fill="none" stroke="black" d="M79.96,-453.18C95.23,-480.56 125.41,-533.7 133,-540 173.12,-573.31 240.9,-534.16 249.98,-573.92"/> -<polygon fill="black" stroke="black" points="246.51,-574.4 251,-584 253.48,-573.7 246.51,-574.4"/> -<text text-anchor="middle" x="76.96" y="-455.78" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode14->Con_13 --> -<g id="edge7" class="edge"> -<title>EQNode14->Con_13</title> -<path fill="none" stroke="black" d="M71,-454.4C71,-465.74 71,-480.77 71,-493.68"/> -<polygon fill="black" stroke="black" points="67.5,-493.9 71,-503.9 74.5,-493.9 67.5,-493.9"/> -<text text-anchor="middle" x="68" y="-457" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If15 --> -<g id="node8" class="node"> -<title>If15</title> -<polygon fill="yellow" stroke="transparent" points="24,-339 24,-364 118,-364 118,-339 24,-339"/> -<polygon fill="none" stroke="black" points="24,-339 24,-364 118,-364 118,-339 24,-339"/> -<text text-anchor="start" x="65.5" y="-347.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="24,-308 24,-339 118,-339 118,-308 24,-308"/> -<polygon fill="yellow" stroke="transparent" points="29,-313 29,-334 69,-334 69,-313 29,-313"/> -<polygon fill="none" stroke="black" points="29,-313 29,-334 69,-334 69,-313 29,-313"/> -<text text-anchor="start" x="32" y="-319.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="69,-313 69,-334 113,-334 113,-313 69,-313"/> -<polygon fill="none" stroke="black" points="69,-313 69,-334 113,-334 113,-313 69,-313"/> -<text text-anchor="start" x="72" y="-319.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If15->If9 --> -<g id="edge8" class="edge"> -<title>If15->If9:p0</title> -<path fill="none" stroke="red" d="M88.21,-368.05C98.39,-385.75 110.98,-406.4 119.78,-416.61"/> -<polygon fill="red" stroke="red" points="117.96,-419.62 128,-423 122.25,-414.1 117.96,-419.62"/> -<text text-anchor="middle" x="85.21" y="-370.65" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If15->EQNode14 --> -<g id="edge9" class="edge"> -<title>If15->EQNode14</title> -<path fill="none" stroke="black" d="M71,-368.01C71,-380.76 71,-395.4 71,-407.73"/> -<polygon fill="black" stroke="black" points="67.5,-407.87 71,-417.87 74.5,-407.87 67.5,-407.87"/> -<text text-anchor="middle" x="68" y="-370.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_19 --> -<g id="node9" class="node"> -<title>Con_19</title> -<ellipse fill="none" stroke="black" cx="443" cy="-336" rx="27" ry="18"/> -<text text-anchor="middle" x="443" y="-332.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_20 --> -<g id="node10" class="node"> -<title>Con_20</title> -<ellipse fill="none" stroke="black" cx="515" cy="-336" rx="27" ry="18"/> -<text text-anchor="middle" x="515" y="-332.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Region21 --> -<g id="node11" class="node"> -<title>Region21</title> -<polygon fill="yellow" stroke="black" points="147,-268 81,-268 81,-232 147,-232 147,-268"/> -<text text-anchor="middle" x="114" y="-246.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region21->If15 --> -<g id="edge10" class="edge"> -<title>Region21->If15:p0</title> -<path fill="none" stroke="red" d="M80.74,-267.13C67.62,-275.57 54.67,-287.24 50.44,-301.92"/> -<polygon fill="red" stroke="red" points="46.94,-301.61 49,-312 53.87,-302.59 46.94,-301.61"/> -<text text-anchor="middle" x="77.74" y="-260.73" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region21->If15 --> -<g id="edge11" class="edge"> -<title>Region21->If15:p1</title> -<path fill="none" stroke="red" d="M103.71,-268.24C98.93,-277.52 93.86,-289.54 91.87,-301.76"/> -<polygon fill="red" stroke="red" points="88.36,-301.74 91,-312 95.34,-302.33 88.36,-301.74"/> -<text text-anchor="middle" x="100.71" y="-270.84" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a22 --> -<g id="node12" class="node"> -<title>Phi_a22</title> -<ellipse fill="lightyellow" stroke="black" cx="407" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="407" y="-246.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a22->Con_19 --> -<g id="edge13" class="edge"> -<title>Phi_a22->Con_19</title> -<path fill="none" stroke="black" d="M414.11,-267.6C419.19,-279.45 426.12,-295.62 431.92,-309.15"/> -<polygon fill="black" stroke="black" points="428.75,-310.63 435.9,-318.44 435.18,-307.87 428.75,-310.63"/> -<text text-anchor="middle" x="411.11" y="-270.2" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a22->Con_20 --> -<g id="edge14" class="edge"> -<title>Phi_a22->Con_20</title> -<path fill="none" stroke="black" d="M425.04,-263.7C439.78,-274.21 461.03,-289.69 479,-304 483.17,-307.32 487.52,-310.94 491.71,-314.49"/> -<polygon fill="black" stroke="black" points="489.59,-317.28 499.45,-321.15 494.15,-311.98 489.59,-317.28"/> -<text text-anchor="middle" x="422.04" y="-266.3" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a22->Region21 --> -<g id="edge12" class="edge"> -<title>Phi_a22->Region21</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M386.5,-238C370.6,-229.42 347.68,-218.6 326,-214 265.57,-201.18 247.16,-199.97 187,-214 175.19,-216.75 163.08,-221.71 152.22,-227.08"/> -<polygon fill="black" stroke="black" points="150.28,-224.14 143.03,-231.86 153.51,-230.35 150.28,-224.14"/> -<text text-anchor="middle" x="383.5" y="-231.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_23 --> -<g id="node13" class="node"> -<title>Con_23</title> -<ellipse fill="none" stroke="black" cx="297" cy="-522" rx="27" ry="18"/> -<text text-anchor="middle" x="297" y="-518.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- EQNode24 --> -<g id="node14" class="node"> -<title>EQNode24</title> -<ellipse fill="none" stroke="black" cx="271" cy="-436" rx="27" ry="18"/> -<text text-anchor="middle" x="271" y="-432.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQNode24->Start2 --> -<g id="edge15" class="edge"> -<title>EQNode24->Start2:p1</title> -<path fill="none" stroke="black" d="M267.14,-454.1C261.74,-479.48 252.43,-528.98 251.15,-573.9"/> -<polygon fill="black" stroke="black" points="247.65,-573.95 251,-584 254.65,-574.05 247.65,-573.95"/> -<text text-anchor="middle" x="264.14" y="-456.7" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQNode24->Con_23 --> -<g id="edge16" class="edge"> -<title>EQNode24->Con_23</title> -<path fill="none" stroke="black" d="M276.26,-454C279.88,-465.69 284.76,-481.44 288.87,-494.73"/> -<polygon fill="black" stroke="black" points="285.53,-495.8 291.84,-504.31 292.22,-493.73 285.53,-495.8"/> -<text text-anchor="middle" x="273.26" y="-456.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If25 --> -<g id="node15" class="node"> -<title>If25</title> -<polygon fill="yellow" stroke="transparent" points="152,-339 152,-364 246,-364 246,-339 152,-339"/> -<polygon fill="none" stroke="black" points="152,-339 152,-364 246,-364 246,-339 152,-339"/> -<text text-anchor="start" x="193.5" y="-347.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="152,-308 152,-339 246,-339 246,-308 152,-308"/> -<polygon fill="yellow" stroke="transparent" points="157,-313 157,-334 197,-334 197,-313 157,-313"/> -<polygon fill="none" stroke="black" points="157,-313 157,-334 197,-334 197,-313 157,-313"/> -<text text-anchor="start" x="160" y="-319.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="197,-313 197,-334 241,-334 241,-313 197,-313"/> -<polygon fill="none" stroke="black" points="197,-313 197,-334 241,-334 241,-313 197,-313"/> -<text text-anchor="start" x="200" y="-319.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If25->If9 --> -<g id="edge17" class="edge"> -<title>If25->If9:p1</title> -<path fill="none" stroke="red" d="M194.16,-368.3C192.87,-378.58 191.7,-390.29 191.23,-401.68"/> -<polygon fill="red" stroke="red" points="187.72,-401.93 191,-412 194.72,-402.08 187.72,-401.93"/> -<text text-anchor="middle" x="191.16" y="-370.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If25->EQNode24 --> -<g id="edge18" class="edge"> -<title>If25->EQNode24</title> -<path fill="none" stroke="black" d="M221.78,-368.01C232.02,-381.95 243.93,-398.15 253.46,-411.12"/> -<polygon fill="black" stroke="black" points="250.89,-413.54 259.63,-419.53 256.53,-409.39 250.89,-413.54"/> -<text text-anchor="middle" x="218.78" y="-370.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_29 --> -<g id="node16" class="node"> -<title>Con_29</title> -<ellipse fill="none" stroke="black" cx="299" cy="-336" rx="27" ry="18"/> -<text text-anchor="middle" x="299" y="-332.3" font-family="Times,serif" font-size="14.00">#4</text> -</g> -<!-- Con_30 --> -<g id="node17" class="node"> -<title>Con_30</title> -<ellipse fill="none" stroke="black" cx="371" cy="-336" rx="27" ry="18"/> -<text text-anchor="middle" x="371" y="-332.3" font-family="Times,serif" font-size="14.00">#5</text> -</g> -<!-- Region31 --> -<g id="node18" class="node"> -<title>Region31</title> -<polygon fill="yellow" stroke="black" points="253,-268 187,-268 187,-232 253,-232 253,-268"/> -<text text-anchor="middle" x="220" y="-246.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region31->If25 --> -<g id="edge19" class="edge"> -<title>Region31->If25:p0</title> -<path fill="none" stroke="red" d="M199.51,-268.03C190.68,-276.94 181.63,-288.71 178.32,-301.78"/> -<polygon fill="red" stroke="red" points="174.81,-301.63 177,-312 181.75,-302.53 174.81,-301.63"/> -<text text-anchor="middle" x="196.51" y="-270.63" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region31->If25 --> -<g id="edge20" class="edge"> -<title>Region31->If25:p1</title> -<path fill="none" stroke="red" d="M219.57,-268.09C219.36,-277.55 219.13,-289.77 219.04,-301.69"/> -<polygon fill="red" stroke="red" points="215.54,-301.99 219,-312 222.54,-302.01 215.54,-301.99"/> -<text text-anchor="middle" x="216.57" y="-270.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a32 --> -<g id="node19" class="node"> -<title>Phi_a32</title> -<ellipse fill="lightyellow" stroke="black" cx="299" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="299" y="-246.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a32->Con_29 --> -<g id="edge22" class="edge"> -<title>Phi_a32->Con_29</title> -<path fill="none" stroke="black" d="M299,-268.4C299,-279.74 299,-294.77 299,-307.68"/> -<polygon fill="black" stroke="black" points="295.5,-307.9 299,-317.9 302.5,-307.9 295.5,-307.9"/> -<text text-anchor="middle" x="296" y="-271" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a32->Con_30 --> -<g id="edge23" class="edge"> -<title>Phi_a32->Con_30</title> -<path fill="none" stroke="black" d="M311.87,-266.02C322.93,-278.92 339.04,-297.71 351.65,-312.42"/> -<polygon fill="black" stroke="black" points="349.07,-314.8 358.24,-320.11 354.39,-310.24 349.07,-314.8"/> -<text text-anchor="middle" x="308.87" y="-268.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a32->Region31 --> -<g id="edge21" class="edge"> -<title>Phi_a32->Region31</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M271.7,-250C268.88,-250 266.06,-250 263.23,-250"/> -<polygon fill="black" stroke="black" points="263.02,-246.5 253.02,-250 263.02,-253.5 263.02,-246.5"/> -<text text-anchor="middle" x="268.7" y="-243.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Region33 --> -<g id="node20" class="node"> -<title>Region33</title> -<polygon fill="yellow" stroke="black" points="253,-196 187,-196 187,-160 253,-160 253,-196"/> -<text text-anchor="middle" x="220" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region33->Region21 --> -<g id="edge24" class="edge"> -<title>Region33->Region21</title> -<path fill="none" stroke="red" d="M194.07,-196.12C180.34,-205.19 163.29,-216.45 148.46,-226.24"/> -<polygon fill="red" stroke="red" points="146.45,-223.38 140.03,-231.81 150.3,-229.22 146.45,-223.38"/> -<text text-anchor="middle" x="191.07" y="-198.72" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region33->Region31 --> -<g id="edge25" class="edge"> -<title>Region33->Region31</title> -<path fill="none" stroke="red" d="M220,-196.3C220,-204.02 220,-213.29 220,-221.89"/> -<polygon fill="red" stroke="red" points="216.5,-221.9 220,-231.9 223.5,-221.9 216.5,-221.9"/> -<text text-anchor="middle" x="217" y="-198.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a34 --> -<g id="node21" class="node"> -<title>Phi_a34</title> -<ellipse fill="lightyellow" stroke="black" cx="299" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="299" y="-174.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a34->Phi_a22 --> -<g id="edge27" class="edge"> -<title>Phi_a34->Phi_a22</title> -<path fill="none" stroke="black" d="M317.81,-191.19C335,-202.33 360.62,-218.94 379.99,-231.5"/> -<polygon fill="black" stroke="black" points="378.11,-234.44 388.4,-236.95 381.92,-228.57 378.11,-234.44"/> -<text text-anchor="middle" x="314.81" y="-193.79" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a34->Phi_a32 --> -<g id="edge28" class="edge"> -<title>Phi_a34->Phi_a32</title> -<path fill="none" stroke="black" d="M299,-196.3C299,-204.02 299,-213.29 299,-221.89"/> -<polygon fill="black" stroke="black" points="295.5,-221.9 299,-231.9 302.5,-221.9 295.5,-221.9"/> -<text text-anchor="middle" x="296" y="-198.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a34->Region33 --> -<g id="edge26" class="edge"> -<title>Phi_a34->Region33</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M271.7,-178C268.88,-178 266.06,-178 263.23,-178"/> -<polygon fill="black" stroke="black" points="263.02,-174.5 253.02,-178 263.02,-181.5 263.02,-174.5"/> -<text text-anchor="middle" x="268.7" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return35->Region33 --> -<g id="edge29" class="edge"> -<title>Return35->Region33</title> -<path fill="none" stroke="red" d="M249.36,-124.3C244.87,-132.36 239.44,-142.11 234.48,-151.02"/> -<polygon fill="red" stroke="red" points="231.34,-149.46 229.53,-159.9 237.45,-152.86 231.34,-149.46"/> -<text text-anchor="middle" x="246.36" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return35->Phi_a34 --> -<g id="edge30" class="edge"> -<title>Return35->Phi_a34</title> -<path fill="none" stroke="black" d="M268.89,-124.3C273.68,-132.68 279.52,-142.9 284.77,-152.1"/> -<polygon fill="black" stroke="black" points="281.77,-153.91 289.77,-160.86 287.85,-150.44 281.77,-153.91"/> -<text text-anchor="middle" x="265.89" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Scope1_0 --> -<g id="node23" class="node"> -<title>Scope1_0</title> -<polygon fill="cyan" stroke="transparent" points="655,-95 655,-116 671,-116 671,-95 655,-95"/> -<polygon fill="none" stroke="black" points="655,-95 655,-116 671,-116 671,-95 655,-95"/> -<text text-anchor="start" x="658" y="-101.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="671,-95 671,-116 711,-116 711,-95 671,-95"/> -<text text-anchor="start" x="674" y="-101.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="711,-95 711,-116 742,-116 742,-95 711,-95"/> -<text text-anchor="start" x="714" y="-101.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope1_0->Start2 --> -<g id="edge31" class="edge"> -<title>Scope1_0:Scope1_0_arg->Start2:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M727,-117C727,-185.37 648,-180.63 648,-249 648,-249 648,-249 648,-437 648,-525.53 378.1,-590.44 277.07,-594.77"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="276.92,-591.27 267,-595 277.08,-598.27 276.92,-591.27"/> -</g> -<!-- Scope1_1 --> -<g id="node24" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="586,-95 586,-116 602,-116 602,-95 586,-95"/> -<polygon fill="none" stroke="black" points="586,-95 586,-116 602,-116 602,-95 586,-95"/> -<text text-anchor="start" x="589" y="-101.8" font-family="Times,serif" font-size="14.00">1</text> -<polygon fill="none" stroke="black" points="602,-95 602,-116 617,-116 617,-95 602,-95"/> -<text text-anchor="start" x="605" y="-101.8" font-family="Times,serif" font-size="14.00">a</text> -</g> -<!-- Scope1_1->Phi_a34 --> -<g id="edge32" class="edge"> -<title>Scope1_1:Scope1_1_a->Phi_a34</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M610,-117C610,-172.18 418.84,-177.72 336.26,-177.53"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="336.07,-174.03 326.06,-177.48 336.04,-181.03 336.07,-174.03"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1594" height="1208" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1594 1208" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(61,193)"><rect class="region-box" rx="8" width="826" height="808" fill="#f2f7ef"/></g><g class="region" transform="translate(73,506)"><rect class="region-box" rx="8" width="410" height="374" fill="#f2f7ef"/></g><g class="region" transform="translate(515,511.7142857142857)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M356,115 C356,139 1494.5,0 1494.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #6 · ASSOC · 0: arg</title></path><path class="edge ASSOC" id="e1i2" d="M431,986 C431,1010 1546,0 1546,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[2] → #34 · ASSOC · 1: a</title></path><path class="edge CTRL" id="e3i0" d="M299,1107 C299,1131 797,1134 797,1158" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #35 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M356,118 L356,128 L342,128 L342,247" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #6 · DATA</title></path><path class="edge DATA" id="e8i2" d="M514,118 L514,128 L422,128 L422,237 L372,237 L372,247" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge CTRL" id="e9i0" d="M236,118 L236,351" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M342,303 L342,313 L316,313 L316,351" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #8 · DATA</title></path><path class="edge DATA" id="e14i1" d="M356,118 L356,128 L247,128 L247,313 L145,313 L145,560" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #6 · DATA</title></path><path class="edge DATA" id="e14i2" d="M84,118 L84,128 L134,128 L134,461 L135,461 L135,550 L175,550 L175,560" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge CTRL" id="e15i0" d="M216,451 L216,461 L215,461 L215,664" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#15[0] → #10 · CTRL</title></path><path class="edge DATA" id="e15i1" d="M145,616 L145,626 L295,626 L295,664" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#15[1] → #14 · DATA</title></path><path class="edge CTRL" id="e21i1" d="M195,764 L195,774 L259,774 L259,812" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[1] → #12 · CTRL</title></path><path class="edge CTRL" id="e21i2" d="M315,764 L315,774 L289,774 L289,812" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[2] → #16 · CTRL</title></path><path class="edge DATA" id="e22i1" d="M666,118 L666,138 L432,138 L432,471 L391,471 L391,812" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[1] → #19 · DATA</title></path><path class="edge DATA" id="e22i2" d="M818,118 L818,148 L443,148 L443,481 L431,481 L431,812" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[2] → #20 · DATA</title></path><path class="edge DATA" id="e24i1" d="M356,118 L356,128 L412,128 L412,461 L687,461 L687,545.7142857142858" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[1] → #6 · DATA</title></path><path class="edge DATA" id="e24i2" d="M970,118 L970,158 L717,158 L717,545.7142857142858" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[2] → #23 · DATA</title></path><path class="edge CTRL" id="e25i0" d="M336,451 L336,491 L607,491 L607,649.7142857142858" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #11 · CTRL</title></path><path class="edge DATA" id="e25i1" d="M687,601.7142857142858 L687,649.7142857142858" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[1] → #24 · DATA</title></path><path class="edge CTRL" id="e31i1" d="M587,749.7142857142858 L587,759.7142857142858 L651,759.7142857142858 L651,797.7142857142858" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[1] → #17 · CTRL</title></path><path class="edge CTRL" id="e31i2" d="M707,749.7142857142858 L707,759.7142857142858 L681,759.7142857142858 L681,797.7142857142858" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[2] → #18 · CTRL</title></path><path class="edge DATA" id="e32i1" d="M1122,118 L1122,168 L783,168 L783,797.7142857142858" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#32[1] → #29 · DATA</title></path><path class="edge DATA" id="e32i2" d="M1274,118 L1274,178 L823,178 L823,797.7142857142858" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#32[2] → #30 · DATA</title></path><path class="edge CTRL" id="e33i1" d="M259,868 L259,895 L279,895 L279,933" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#33[1] → #21 · CTRL</title></path><path class="edge CTRL" id="e33i2" d="M651,853.7142857142858 L651,895 L309,895 L309,933" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#33[2] → #31 · CTRL</title></path><path class="edge DATA" id="e34i1" d="M411,868 L411,933" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#34[1] → #22 · DATA</title></path><path class="edge DATA" id="e34i2" d="M803,853.7142857142858 L803,905 L451,905 L451,933" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#34[2] → #32 · DATA</title></path><path class="edge CTRL" id="e35i0" d="M279,989 L279,1054" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#35[0] → #33 · CTRL</title></path><path class="edge DATA" id="e35i1" d="M431,989 L431,1016 L319,1016 L319,1054" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[1] → #34 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(1406,24)" style="opacity: 1;"><path class="box" d="M4,0H160Q164,0 164,4V52Q164,56 160,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="82" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="82"/><title>#1 Scope +Type not computed + +[0] → — ASSOC 0: $ctrl +[1] → #6 ASSOC 0: arg +[2] → #34 ASSOC 1: a</title><line class="row" x1="0" x2="164" y1="30" y2="30"/><line class="row" x1="61" x2="61" y1="0" y2="30"/><line class="row" x1="116" x2="116" y1="0" y2="30"/><text class="bind" x="30.5" y="20" text-anchor="middle">0: $ctrl</text><text class="bind" x="88.5" y="20" text-anchor="middle">0: arg</text><text class="bind" x="140" y="20" text-anchor="middle">1: a</text><circle class="port" cx="30.5" cy="0" r="3" fill="white"/><circle class="port" cx="88.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="140" cy="0" r="3" fill="#536477"/><text class="slot" x="30.5" y="-7" text-anchor="middle">0</text><text class="slot" x="88.5" y="-7" text-anchor="middle">1</text><text class="slot" x="140" y="-7" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(761,1158)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #35 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n5" data-id="5" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n7" data-id="7" transform="translate(454,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #1 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(282,253)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 == +Type not computed + +[0] → — DATA +[1] → #6 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(156,357)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#9 If +Type not computed + +[0] → #5 CTRL +[1] → #8 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n10" data-id="10" transform="translate(156,401)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #10/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 True +Projection 0 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(276,401)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #11/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 False +Projection 1 of #9 +Type not computed + +[0] → #9 CTRL</title></g><g class="node" id="n12" data-id="12" transform="translate(135,714)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #12/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 True +Projection 0 of #15 +Type not computed + +[0] → #15 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #2 +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(85,566)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 == +Type not computed + +[0] → — DATA +[1] → #6 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(135,670)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#15 If +Type not computed + +[0] → #10 CTRL +[1] → #14 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n16" data-id="16" transform="translate(255,714)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #16/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 False +Projection 1 of #15 +Type not computed + +[0] → #15 CTRL</title></g><g class="node" id="n17" data-id="17" transform="translate(527,699.7142857142858)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #17/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 True +Projection 0 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n18" data-id="18" transform="translate(647,699.7142857142858)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #18/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 False +Projection 1 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n19" data-id="19" transform="translate(606,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 #2 +Type not computed + +</title></g><g class="node" id="n20" data-id="20" transform="translate(758,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 #3 +Type not computed + +</title></g><g class="node" id="n21" data-id="21" transform="translate(199,818)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Region +Type not computed + +[0] → — DATA +[1] → #12 CTRL +[2] → #16 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n22" data-id="22" transform="translate(351,818)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 φ_a +Type not computed + +[0] → #21 ASSOC +[1] → #19 DATA +[2] → #20 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #21</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n23" data-id="23" transform="translate(910,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 #3 +Type not computed + +</title></g><g class="node" id="n24" data-id="24" transform="translate(627,551.7142857142858)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 == +Type not computed + +[0] → — DATA +[1] → #6 DATA +[2] → #23 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n25" data-id="25" transform="translate(527,655.7142857142858)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#25 If +Type not computed + +[0] → #11 CTRL +[1] → #24 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n29" data-id="29" transform="translate(1062,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#4</tspan><tspan class="node-id">  #29</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#29 #4 +Type not computed + +</title></g><g class="node" id="n30" data-id="30" transform="translate(1214,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #30</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#30 #5 +Type not computed + +</title></g><g class="node" id="n31" data-id="31" transform="translate(591,803.7142857142858)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #31</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#31 Region +Type not computed + +[0] → — DATA +[1] → #17 CTRL +[2] → #18 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n32" data-id="32" transform="translate(743,803.7142857142858)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #32</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#32 φ_a +Type not computed + +[0] → #31 ASSOC +[1] → #29 DATA +[2] → #30 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #31</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n33" data-id="33" transform="translate(219,939)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #33</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#33 Region +Type not computed + +[0] → — DATA +[1] → #21 CTRL +[2] → #31 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n34" data-id="34" transform="translate(371,939)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #34</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#34 φ_a +Type not computed + +[0] → #33 ASSOC +[1] → #22 DATA +[2] → #32 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #33</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n35" data-id="35" transform="translate(239,1060)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #35</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#35 Return +Type not computed + +[0] → #33 CTRL +[1] → #34 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(61,193)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #9</tspan></text><title>If · 18 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #9"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(73,506)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #15</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #15"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(515,511.7142857142857)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #25"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/05-graph9.json b/chapter05/docs/05-graph9.json new file mode 100644 index 00000000..deb1b540 --- /dev/null +++ b/chapter05/docs/05-graph9.json @@ -0,0 +1,26 @@ +{ + "ver": 1, + "comp": "chapter05/docs/05-graph9.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 20, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, + {"id": 8, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 14, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 17, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 6, "role": "CTRL", "label": null}], "proj": null}, + {"id": 18, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 17, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}, {"idx": 1, "def": 18, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 10, "par": 0, "nodes": [5, 6, 9, 10, 17, 18]} + ] +} diff --git a/chapter05/docs/05-graph9.svg b/chapter05/docs/05-graph9.svg index dff4d63f..cc52c5bd 100644 --- a/chapter05/docs/05-graph9.svg +++ b/chapter05/docs/05-graph9.svg @@ -1,174 +1,117 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.40.1 (20161225.0304) - --> -<!-- Title: chapter05 Pages: 1 --> -<svg width="277pt" height="496pt" viewBox="0.00 0.00 277.00 496.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 492)"> -<title>chapter05</title> -<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-492 273,-492 273,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="#000000" points="8,-8 8,-480 261,-480 261,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="#ffff00" stroke="transparent" points="109,-442 109,-468 173,-468 173,-442 109,-442"/> -<polygon fill="none" stroke="#000000" points="109,-442 109,-468 173,-468 173,-442 109,-442"/> -<text text-anchor="start" x="127.7805" y="-450.4" font-family="Times,serif" font-size="14.00" fill="#000000">Start</text> -<polygon fill="none" stroke="#000000" points="109,-410 109,-442 173,-442 173,-410 109,-410"/> -<polygon fill="#ffff00" stroke="transparent" points="114,-415 114,-437 145,-437 145,-415 114,-415"/> -<polygon fill="none" stroke="#000000" points="114,-415 114,-437 145,-437 145,-415 114,-415"/> -<text text-anchor="start" x="116.6718" y="-421.4" font-family="Times,serif" font-size="14.00" fill="#000000">$ctrl</text> -<polygon fill="none" stroke="#000000" points="145,-415 145,-437 168,-437 168,-415 145,-415"/> -<text text-anchor="start" x="147.5624" y="-421.4" font-family="Times,serif" font-size="14.00" fill="#000000">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="#ffff00" stroke="#000000" points="179,-52 125,-52 125,-16 179,-16 179,-52"/> -<text text-anchor="middle" x="152" y="-29.8" font-family="Times,serif" font-size="14.00" fill="#000000">Stop</text> -</g> -<!-- Return20 --> -<g id="node10" class="node"> -<title>Return20</title> -<polygon fill="#ffff00" stroke="#000000" points="179.1025,-124 124.8975,-124 124.8975,-88 179.1025,-88 179.1025,-124"/> -<text text-anchor="middle" x="152" y="-101.8" font-family="Times,serif" font-size="14.00" fill="#000000">Return</text> -</g> -<!-- Stop3->Return20 --> -<g id="edge1" class="edge"> -<title>Stop3->Return20</title> -<path fill="none" stroke="#ff0000" d="M152,-52.1686C152,-59.869 152,-69.0257 152,-77.5834"/> -<polygon fill="#ff0000" stroke="#ff0000" points="148.5001,-77.5867 152,-87.5867 155.5001,-77.5868 148.5001,-77.5867"/> -<text text-anchor="middle" x="149.7764" y="-54.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Con_8 --> -<g id="node3" class="node"> -<title>Con_8</title> -<ellipse fill="none" stroke="#000000" cx="226" cy="-439" rx="27" ry="18"/> -<text text-anchor="middle" x="226" y="-434.8" font-family="Times,serif" font-size="14.00" fill="#000000">1</text> -</g> -<!-- EQ9 --> -<g id="node4" class="node"> -<title>EQ9</title> -<ellipse fill="none" stroke="#000000" cx="207" cy="-352" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-347.8" font-family="Times,serif" font-size="14.00" fill="#000000">==</text> -</g> -<!-- EQ9->Start2 --> -<g id="edge2" class="edge"> -<title>EQ9->Start2:p1</title> -<path fill="none" stroke="#000000" d="M188.0971,-364.9135C176.261,-374.4033 162.483,-388.4885 158.2807,-405.0084"/> -<polygon fill="#000000" stroke="#000000" points="154.7998,-404.6361 157,-415 161.743,-405.5261 154.7998,-404.6361"/> -<text text-anchor="middle" x="190.3207" y="-367.3135" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- EQ9->Con_8 --> -<g id="edge3" class="edge"> -<title>EQ9->Con_8</title> -<path fill="none" stroke="#000000" d="M210.9368,-370.0265C213.5098,-381.8082 216.9235,-397.4393 219.8505,-410.8419"/> -<polygon fill="#000000" stroke="#000000" points="216.5151,-411.9737 222.0682,-420.9966 223.3539,-410.4801 216.5151,-411.9737"/> -<text text-anchor="middle" x="208.7132" y="-372.4265" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">2</text> -</g> -<!-- If10 --> -<g id="node5" class="node"> -<title>If10</title> -<polygon fill="#ffff00" stroke="transparent" points="169,-268 169,-294 246,-294 246,-268 169,-268"/> -<polygon fill="none" stroke="#000000" points="169,-268 169,-294 246,-294 246,-268 169,-268"/> -<text text-anchor="start" x="202.8394" y="-276.4" font-family="Times,serif" font-size="14.00" fill="#000000">If</text> -<polygon fill="none" stroke="#000000" points="169,-236 169,-268 246,-268 246,-236 169,-236"/> -<polygon fill="#ffff00" stroke="transparent" points="174,-241 174,-263 206,-263 206,-241 174,-241"/> -<polygon fill="none" stroke="#000000" points="174,-241 174,-263 206,-263 206,-241 174,-241"/> -<text text-anchor="start" x="176.7861" y="-247.4" font-family="Times,serif" font-size="14.00" fill="#000000">True</text> -<polygon fill="#ffff00" stroke="transparent" points="206,-241 206,-263 241,-263 241,-241 206,-241"/> -<polygon fill="none" stroke="#000000" points="206,-241 206,-263 241,-263 241,-241 206,-241"/> -<text text-anchor="start" x="208.7265" y="-247.4" font-family="Times,serif" font-size="14.00" fill="#000000">False</text> -</g> -<!-- If10->Start2 --> -<g id="edge4" class="edge"> -<title>If10->Start2:p0</title> -<path fill="none" stroke="#ff0000" d="M177.9557,-298.2089C157.4684,-324.8446 133.0529,-364.3668 129.4523,-404.9472"/> -<polygon fill="#ff0000" stroke="#ff0000" points="125.9531,-404.8528 129,-415 132.946,-405.1674 125.9531,-404.8528"/> -<text text-anchor="middle" x="175.7321" y="-300.6089" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- If10->EQ9 --> -<g id="edge5" class="edge"> -<title>If10->EQ9</title> -<path fill="none" stroke="#000000" d="M207,-298.3877C207,-306.7839 207,-315.7123 207,-323.8253"/> -<polygon fill="#000000" stroke="#000000" points="203.5001,-323.9075 207,-333.9075 210.5001,-323.9075 203.5001,-323.9075"/> -<text text-anchor="middle" x="204.7764" y="-300.7877" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Con_14 --> -<g id="node6" class="node"> -<title>Con_14</title> -<ellipse fill="none" stroke="#000000" cx="43" cy="-265" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-260.8" font-family="Times,serif" font-size="14.00" fill="#000000">2</text> -</g> -<!-- Con_16 --> -<g id="node7" class="node"> -<title>Con_16</title> -<ellipse fill="none" stroke="#000000" cx="115" cy="-265" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-260.8" font-family="Times,serif" font-size="14.00" fill="#000000">1</text> -</g> -<!-- Region17 --> -<g id="node8" class="node"> -<title>Region17</title> -<polygon fill="#ffff00" stroke="#000000" points="217.4435,-196 160.5565,-196 160.5565,-160 217.4435,-160 217.4435,-196"/> -<text text-anchor="middle" x="189" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">Region</text> -</g> -<!-- Region17->If10 --> -<g id="edge6" class="edge"> -<title>Region17->If10:p0</title> -<path fill="none" stroke="#ff0000" d="M189.4415,-196.1943C189.6508,-206.0242 189.874,-218.6285 189.9616,-230.8706"/> -<polygon fill="#ff0000" stroke="#ff0000" points="186.462,-231.0134 190,-241 193.4619,-230.9868 186.462,-231.0134"/> -<text text-anchor="middle" x="187.2179" y="-198.5943" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Region17->If10 --> -<g id="edge7" class="edge"> -<title>Region17->If10:p1</title> -<path fill="none" stroke="#ff0000" d="M205.4751,-196.1305C212.7091,-205.5926 220.1774,-217.8998 222.9129,-230.93"/> -<polygon fill="#ff0000" stroke="#ff0000" points="219.4469,-231.4334 224,-241 226.4064,-230.6821 219.4469,-231.4334"/> -<text text-anchor="middle" x="203.2515" y="-198.5305" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">2</text> -</g> -<!-- Phi_b18 --> -<g id="node9" class="node"> -<title>Phi_b18</title> -<ellipse fill="#ffffe0" stroke="#000000" cx="115" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-173.8" font-family="Times,serif" font-size="14.00" fill="#000000">φ_b</text> -</g> -<!-- Phi_b18->Con_14 --> -<g id="edge9" class="edge"> -<title>Phi_b18->Con_14</title> -<path fill="none" stroke="#000000" d="M101.7941,-193.9571C90.8328,-207.202 75.0821,-226.2341 62.6416,-241.2664"/> -<polygon fill="#000000" stroke="#000000" points="59.8015,-239.2086 56.1222,-249.144 65.1943,-243.6716 59.8015,-239.2086"/> -<text text-anchor="middle" x="99.5705" y="-196.3571" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -<!-- Phi_b18->Con_16 --> -<g id="edge10" class="edge"> -<title>Phi_b18->Con_16</title> -<path fill="none" stroke="#000000" d="M115,-196.0265C115,-207.8082 115,-223.4393 115,-236.8419"/> -<polygon fill="#000000" stroke="#000000" points="111.5001,-236.9966 115,-246.9966 118.5001,-236.9967 111.5001,-236.9966"/> -<text text-anchor="middle" x="112.7764" y="-198.4265" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">2</text> -</g> -<!-- Phi_b18->Region17 --> -<g id="edge8" class="edge"> -<title>Phi_b18->Region17</title> -<path fill="none" stroke="#000000" stroke-dasharray="1,5" d="M142.1719,-178C144.9348,-178 147.6977,-178 150.4605,-178"/> -<polygon fill="#000000" stroke="#000000" points="150.4641,-181.5001 160.4641,-178 150.4641,-174.5001 150.4641,-181.5001"/> -<text text-anchor="middle" x="144.3955" y="-170.8" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return20->Region17 --> -<g id="edge11" class="edge"> -<title>Return20->Region17</title> -<path fill="none" stroke="#ff0000" d="M161.3367,-124.1686C165.4243,-132.1229 170.3104,-141.631 174.8309,-150.4277"/> -<polygon fill="#ff0000" stroke="#ff0000" points="171.8539,-152.2922 179.5376,-159.5867 178.0799,-149.0926 171.8539,-152.2922"/> -<text text-anchor="middle" x="159.1131" y="-126.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">0</text> -</g> -<!-- Return20->Phi_b18 --> -<g id="edge12" class="edge"> -<title>Return20->Phi_b18</title> -<path fill="none" stroke="#000000" d="M142.6633,-124.1686C138.4051,-132.4549 133.2804,-142.4273 128.6051,-151.5252"/> -<polygon fill="#000000" stroke="#000000" points="125.4085,-150.0882 123.9508,-160.5823 131.6345,-153.2877 125.4085,-150.0882"/> -<text text-anchor="middle" x="140.4397" y="-126.5686" font-family="Helvetica,sans-Serif" font-size="8.00" fill="#000000">1</text> -</g> -</g> -</svg>
\ No newline at end of file +<svg aria-label="Compiler graph" width="782" height="734" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 782 734" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,633 C180,657 391,660 391,684" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #20 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M236,118 L236,128 L196,128 L196,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M394,118 L394,138 L226,138 L226,207" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #8 · DATA</title></path><path class="edge CTRL" id="e10i0" d="M116,118 L116,311" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #1 · CTRL</title></path><path class="edge DATA" id="e10i1" d="M196,263 L196,311" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path><path class="edge CTRL" id="e17i1" d="M96,411 L96,421 L160,421 L160,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e17i2" d="M216,411 L216,421 L190,421 L190,459" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[2] → #6 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M546,118 L546,148 L292,148 L292,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #14 · DATA</title></path><path class="edge DATA" id="e18i2" d="M698,118 L698,158 L332,158 L332,459" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #16 · DATA</title></path><path class="edge CTRL" id="e20i0" d="M160,515 L160,580" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#20[0] → #17 · CTRL</title></path><path class="edge DATA" id="e20i1" d="M312,515 L312,542 L200,542 L200,580" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[1] → #18 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(56,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(56,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(355,684)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #20 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(36,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(156,361)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #10 +Type not computed + +[0] → #10 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(334,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 1 +Type not computed + +</title></g><g class="node" id="n9" data-id="9" transform="translate(136,213)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 == +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #8 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(36,317)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#10 If +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n14" data-id="14" transform="translate(486,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>2</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 2 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(638,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 1 +Type not computed + +</title></g><g class="node" id="n17" data-id="17" transform="translate(100,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #6 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(252,465)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_b</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 φ_b +Type not computed + +[0] → #17 ASSOC +[1] → #14 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #17</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n20" data-id="20" transform="translate(120,586)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 Return +Type not computed + +[0] → #17 CTRL +[1] → #18 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,173)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #10</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #10"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter05/docs/Makefile b/chapter05/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter05/docs/Makefile +++ b/chapter05/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter06/README.md b/chapter06/README.md index 3442b1cc..14e21bbc 100644 --- a/chapter06/README.md +++ b/chapter06/README.md @@ -1,10 +1,13 @@ # Chapter 6: Peepholes for If +[Previous: Chapter 5](../chapter05/README.md) | +[Next: Chapter 7](../chapter07/README.md) + # Table of Contents 1. [Type System Revision](#type-system-revision) 2. [Peephole of `if`](#peephole-of-if) -3. [`Region` and `Phi`](#Region-and-Phi) +3. [`Region` and `Phi`](#region-and-phi) 4. [Discussion](#discussion) 5. [Expanding Peephole Beyond Constant Expressions](#expanding-peephole-beyond-constant-expressions) 6. [Dominators](#dominators) @@ -48,7 +51,7 @@ The entire revised Lattice is shown below: parsing, the normal graph building machinery takes care of cleaning up dead nodes. * When we peephole an `If` node we test if the predicate is a constant. If so, - then one branch or the other dead, depending on if the constant is `0` or not. + then one branch or the other is dead, depending on if the constant is `0` or not. * When we add the `Proj` nodes, in this scenario, we already know one of the projections is dead. The peephole of the relevant `Proj` node replaces the `Proj` with a `Constant` of type "~Ctrl" indicating dead control. * At this point our dead code elimination would kill the `If` node since it has no uses @@ -62,7 +65,7 @@ The entire revised Lattice is shown below: * The parsing then continues as normal. * The other changes are when we reach the merge point with a dead control. * Again keeping with our strategy we merge as normal, including creating `Phi` nodes. -* The `Region` may have have one of its inputs as "~Ctrl". This will be seen +* The `Region` may have one of its inputs as "~Ctrl". This will be seen by the `Phi` which then optimizes itself. If the `Phi` has just one live input, the `Phi` peephole replaces itself with the remaining input. * Finally, at the end, when the `Region` node is peepholed, we see that it has only one live input and no Phi uses @@ -70,7 +73,7 @@ The entire revised Lattice is shown below: ## `Region` and `Phi` -One of the invariants we maintain is that the for each control input to a +One of the invariants we maintain is that for each control input to a `Region` every `Phi` has a 1-to-1 relationship with a data input. Thus, if a `Region` loses a control input, every `Phi`'s corresponding data input must be deleted. Conversely, we cannot collapse a Region until it has no dependent @@ -122,7 +125,7 @@ After peephole: ## Expanding Peephole Beyond Constant Expressions While our peephole of the `CFG` collapses dead code when the expression is -a compile time constant. it does not do as well as it could with following example: +a compile-time constant, it does not do as well as it could with the following example: ```java int a = 0; @@ -188,7 +191,7 @@ the outcome of the present `if` is fully determined. The code that does this check is in the [`compute` method of the `if`](https://github.com/SeaOfNodes/Simple/blob/main/chapter06/src/main/java/com/seaofnodes/simple/node/IfNode.java#L38-L45). The `idom` method in `Node` provides a default implementation of the depth based immediate dominator calculation. -`Region`'s [override this](https://github.com/SeaOfNodes/Simple/blob/main/chapter06/src/main/java/com/seaofnodes/simple/node/RegionNode.java#L57-L74) to implement the more complex search described above. +`Region` [overrides this](https://github.com/SeaOfNodes/Simple/blob/main/chapter06/src/main/java/com/seaofnodes/simple/node/RegionNode.java#L57-L74) to implement the more complex search described above. It turns out that to simplify the example above, we need a [further peephole in our `Add` node](https://github.com/SeaOfNodes/Simple/blob/main/chapter06/src/main/java/com/seaofnodes/simple/node/AddNode.java#L64-L67). diff --git a/chapter06/docs/06-graph1-post.json b/chapter06/docs/06-graph1-post.json new file mode 100644 index 00000000..325d473a --- /dev/null +++ b/chapter06/docs/06-graph1-post.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter06/docs/06-graph1-post.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 13, "role": "CTRL", "label": null}], "proj": null}, + {"id": 12, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 13, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter06/docs/06-graph1-post.svg b/chapter06/docs/06-graph1-post.svg index faabcd8c..faef1501 100644 --- a/chapter06/docs/06-graph1-post.svg +++ b/chapter06/docs/06-graph1-post.svg @@ -1,67 +1,80 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter06 Pages: 1 --> -<svg width="178pt" height="248pt" - viewBox="0.00 0.00 178.00 248.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 244)"> -<title>chapter06</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-244 174,-244 174,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-232 162,-232 162,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="24,-195 24,-220 74,-220 74,-195 24,-195"/> -<polygon fill="none" stroke="black" points="24,-195 24,-220 74,-220 74,-195 24,-195"/> -<text text-anchor="start" x="30.5" y="-203.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="24,-164 24,-195 74,-195 74,-164 24,-164"/> -<polygon fill="yellow" stroke="transparent" points="29,-169 29,-190 69,-190 69,-169 29,-169"/> -<polygon fill="none" stroke="black" points="29,-169 29,-190 69,-190 69,-169 29,-169"/> -<text text-anchor="start" x="32" y="-175.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="112,-52 58,-52 58,-16 112,-16 112,-52"/> -<text text-anchor="middle" x="85" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return13 --> -<g id="node4" class="node"> -<title>Return13</title> -<polygon fill="yellow" stroke="black" points="118,-124 52,-124 52,-88 118,-88 118,-124"/> -<text text-anchor="middle" x="85" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return13 --> -<g id="edge1" class="edge"> -<title>Stop3->Return13</title> -<path fill="none" stroke="red" d="M85,-52.3C85,-60.02 85,-69.29 85,-77.89"/> -<polygon fill="red" stroke="red" points="81.5,-77.9 85,-87.9 88.5,-77.9 81.5,-77.9"/> -<text text-anchor="middle" x="82" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_12 --> -<g id="node3" class="node"> -<title>Con_12</title> -<ellipse fill="none" stroke="black" cx="127" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="127" y="-188.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Return13->Start2 --> -<g id="edge2" class="edge"> -<title>Return13->Start2:p0</title> -<path fill="none" stroke="red" d="M68.26,-124.13C60.77,-133.26 52.99,-145.23 50.13,-158.06"/> -<polygon fill="red" stroke="red" points="46.66,-157.67 49,-168 53.61,-158.46 46.66,-157.67"/> -<text text-anchor="middle" x="65.26" y="-126.73" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return13->Con_12 --> -<g id="edge3" class="edge"> -<title>Return13->Con_12</title> -<path fill="none" stroke="black" d="M93.7,-124.4C99.66,-136.31 107.65,-152.3 114.31,-165.62"/> -<polygon fill="black" stroke="black" points="111.28,-167.38 118.88,-174.76 117.54,-164.25 111.28,-167.38"/> -<text text-anchor="middle" x="90.7" y="-127" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="326" height="320" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 326 320" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #13 · CTRL</title></path><path class="edge CTRL" id="e13i0" d="M84,118 L84,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#13[0] → #1 · CTRL</title></path><path class="edge DATA" id="e13i1" d="M242,118 L242,128 L124,128 L124,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[1] → #12 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(127,270)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #13 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n12" data-id="12" transform="translate(182,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 #2 +Type not computed + +</title></g><g class="node" id="n13" data-id="13" transform="translate(44,172)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 Return +Type not computed + +[0] → #1 CTRL +[1] → #12 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter06/docs/06-graph1-pre.json b/chapter06/docs/06-graph1-pre.json new file mode 100644 index 00000000..18615f2c --- /dev/null +++ b/chapter06/docs/06-graph1-pre.json @@ -0,0 +1,24 @@ +{ + "ver": 1, + "comp": "chapter06/docs/06-graph1-pre.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}, {"idx": 1, "def": 16, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}], "proj": {"par": 7, "idx": 0}}, + {"id": 5, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}], "proj": {"par": 7, "idx": 1}}, + {"id": 6, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "#~CONTROL", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 15, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 14, "role": "CTRL", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter06/docs/06-graph1-pre.svg b/chapter06/docs/06-graph1-pre.svg index f80edcfc..2ba929f8 100644 --- a/chapter06/docs/06-graph1-pre.svg +++ b/chapter06/docs/06-graph1-pre.svg @@ -1,160 +1,111 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter06 Pages: 1 --> -<svg width="316pt" height="420pt" - viewBox="0.00 0.00 316.00 420.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 416)"> -<title>chapter06</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-416 312,-416 312,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-404 300,-404 300,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="35,-367 35,-392 85,-392 85,-367 35,-367"/> -<polygon fill="none" stroke="black" points="35,-367 35,-392 85,-392 85,-367 35,-367"/> -<text text-anchor="start" x="41.5" y="-375.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="35,-336 35,-367 85,-367 85,-336 35,-336"/> -<polygon fill="yellow" stroke="transparent" points="40,-341 40,-362 80,-362 80,-341 40,-341"/> -<polygon fill="none" stroke="black" points="40,-341 40,-362 80,-362 80,-341 40,-341"/> -<text text-anchor="start" x="43" y="-347.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="150,-52 96,-52 96,-16 150,-16 150,-52"/> -<text text-anchor="middle" x="123" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return12 --> -<g id="node6" class="node"> -<title>Return12</title> -<polygon fill="yellow" stroke="black" points="114,-124 48,-124 48,-88 114,-88 114,-124"/> -<text text-anchor="middle" x="81" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return12 --> -<g id="edge1" class="edge"> -<title>Stop3->Return12</title> -<path fill="none" stroke="red" d="M112.62,-52.3C107.74,-60.44 101.81,-70.31 96.42,-79.3"/> -<polygon fill="red" stroke="red" points="93.41,-77.52 91.26,-87.9 99.41,-81.12 93.41,-77.52"/> -<text text-anchor="middle" x="109.62" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return16 --> -<g id="node10" class="node"> -<title>Return16</title> -<polygon fill="yellow" stroke="black" points="198,-124 132,-124 132,-88 198,-88 198,-124"/> -<text text-anchor="middle" x="165" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return16 --> -<g id="edge2" class="edge"> -<title>Stop3->Return16</title> -<path fill="none" stroke="red" d="M133.38,-52.3C138.26,-60.44 144.19,-70.31 149.58,-79.3"/> -<polygon fill="red" stroke="red" points="146.59,-81.12 154.74,-87.9 152.59,-77.52 146.59,-81.12"/> -<text text-anchor="middle" x="130.38" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="138" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="138" y="-360.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- If7 --> -<g id="node4" class="node"> -<title>If7</title> -<polygon fill="yellow" stroke="transparent" points="24,-267 24,-292 118,-292 118,-267 24,-267"/> -<polygon fill="none" stroke="black" points="24,-267 24,-292 118,-292 118,-267 24,-267"/> -<text text-anchor="start" x="65.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="24,-236 24,-267 118,-267 118,-236 24,-236"/> -<polygon fill="yellow" stroke="transparent" points="29,-241 29,-262 69,-262 69,-241 29,-241"/> -<polygon fill="none" stroke="black" points="29,-241 29,-262 69,-262 69,-241 29,-241"/> -<text text-anchor="start" x="32" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="69,-241 69,-262 113,-262 113,-241 69,-241"/> -<polygon fill="none" stroke="black" points="69,-241 69,-262 113,-262 113,-241 69,-241"/> -<text text-anchor="start" x="72" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If7->Start2 --> -<g id="edge3" class="edge"> -<title>If7->Start2:p0</title> -<path fill="none" stroke="red" d="M64.35,-296.23C62.56,-306.6 60.93,-318.45 60.29,-329.99"/> -<polygon fill="red" stroke="red" points="56.79,-329.9 60,-340 63.79,-330.11 56.79,-329.9"/> -<text text-anchor="middle" x="61.35" y="-298.83" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If7->Con_6 --> -<g id="edge4" class="edge"> -<title>If7->Con_6</title> -<path fill="none" stroke="black" d="M92.2,-296.01C101.67,-309.86 112.66,-325.94 121.5,-338.87"/> -<polygon fill="black" stroke="black" points="118.7,-340.97 127.24,-347.25 124.48,-337.02 118.7,-340.97"/> -<text text-anchor="middle" x="89.2" y="-298.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_11 --> -<g id="node5" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="black" cx="43" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-174.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Return12->If7 --> -<g id="edge5" class="edge"> -<title>Return12->If7:p0</title> -<path fill="none" stroke="red" d="M83.45,-124.21C85.4,-142.49 86.7,-172.01 79,-196 73.01,-214.66 56.37,-216.36 50.82,-229.83"/> -<polygon fill="red" stroke="red" points="47.32,-229.54 49,-240 54.21,-230.77 47.32,-229.54"/> -<text text-anchor="middle" x="80.45" y="-126.81" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return12->Con_11 --> -<g id="edge6" class="edge"> -<title>Return12->Con_11</title> -<path fill="none" stroke="black" d="M71.61,-124.3C67.1,-132.6 61.63,-142.69 56.67,-151.81"/> -<polygon fill="black" stroke="black" points="53.46,-150.4 51.76,-160.86 59.61,-153.74 53.46,-150.4"/> -<text text-anchor="middle" x="68.61" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_13 --> -<g id="node7" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="218" cy="-264" rx="74.19" ry="18"/> -<text text-anchor="middle" x="218" y="-260.3" font-family="Times,serif" font-size="14.00">#~CONTROL</text> -</g> -<!-- Region14 --> -<g id="node8" class="node"> -<title>Region14</title> -<polygon fill="yellow" stroke="black" points="190,-196 124,-196 124,-160 190,-160 190,-196"/> -<text text-anchor="middle" x="157" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region14->If7 --> -<g id="edge8" class="edge"> -<title>Region14->If7:p1</title> -<path fill="none" stroke="red" d="M150.64,-196.06C144.08,-212.53 133.37,-236.39 122.96,-246.35"/> -<polygon fill="red" stroke="red" points="121.27,-243.29 114,-251 124.49,-249.5 121.27,-243.29"/> -<text text-anchor="middle" x="147.64" y="-198.66" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region14->Con_13 --> -<g id="edge7" class="edge"> -<title>Region14->Con_13</title> -<path fill="none" stroke="black" d="M169.64,-196.4C178.34,-208.39 190.04,-224.5 199.75,-237.87"/> -<polygon fill="black" stroke="black" points="197.09,-240.16 205.79,-246.19 202.75,-236.04 197.09,-240.16"/> -<text text-anchor="middle" x="166.64" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node9" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="235" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="235" y="-174.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Return16->Region14 --> -<g id="edge9" class="edge"> -<title>Return16->Region14</title> -<path fill="none" stroke="red" d="M163.02,-124.3C162.14,-132.02 161.08,-141.29 160.1,-149.89"/> -<polygon fill="red" stroke="red" points="156.61,-149.56 158.95,-159.9 163.57,-150.36 156.61,-149.56"/> -<text text-anchor="middle" x="160.02" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return16->Con_15 --> -<g id="edge10" class="edge"> -<title>Return16->Con_15</title> -<path fill="none" stroke="black" d="M182.3,-124.3C191.72,-133.72 203.47,-145.47 213.47,-155.47"/> -<polygon fill="black" stroke="black" points="211.18,-158.12 220.72,-162.72 216.12,-153.18 211.18,-158.12"/> -<text text-anchor="middle" x="179.3" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="598" height="572" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 598 572" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M256,367 C256,391 287,498 287,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #12 · CTRL</title></path><path class="edge CTRL" id="e3i1" d="M124,471 C124,495 311,498 311,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[1] → #16 · CTRL</title></path><path class="edge CTRL" id="e7i0" d="M256,118 L256,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#7[0] → #1 · CTRL</title></path><path class="edge DATA" id="e7i1" d="M414,118 L414,128 L336,128 L336,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #6 · DATA</title></path><path class="edge CTRL" id="e12i0" d="M236,266 L236,314" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #4 · CTRL</title></path><path class="edge DATA" id="e12i1" d="M514,266 L514,286 L276,286 L276,314" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #11 · DATA</title></path><path class="edge DATA" id="e14i1" d="M84,266 L84,276 L104,276 L104,314" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #13 · DATA</title></path><path class="edge CTRL" id="e14i2" d="M356,266 L356,276 L134,276 L134,314" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[2] → #5 · CTRL</title></path><path class="edge CTRL" id="e16i0" d="M104,370 L104,418" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #14 · CTRL</title></path><path class="edge DATA" id="e16i1" d="M408,370 L408,380 L144,380 L144,418" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #15 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(196,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(196,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(263,522)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #12 CTRL +[1] → #16 CTRL</title><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="48" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="48" y="-7" text-anchor="middle">1</text></g><g class="node" id="n4" data-id="4" transform="translate(176,216)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 True +Projection 0 of #7 +Type not computed + +[0] → #7 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(296,216)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #5/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 False +Projection 1 of #7 +Type not computed + +[0] → #7 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(354,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #1 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(176,172)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#7 If +Type not computed + +[0] → #1 CTRL +[1] → #6 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n11" data-id="11" transform="translate(454,216)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #2 +Type not computed + +</title></g><g class="node" id="n12" data-id="12" transform="translate(196,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 Return +Type not computed + +[0] → #4 CTRL +[1] → #11 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n13" data-id="13" transform="translate(24,216)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#~CONTROL</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #~CONTROL +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(44,320)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 Region +Type not computed + +[0] → — DATA +[1] → #13 DATA +[2] → #5 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(348,320)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 #1 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(64,424)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 Return +Type not computed + +[0] → #14 CTRL +[1] → #15 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter06/docs/06-graph2-post.json b/chapter06/docs/06-graph2-post.json new file mode 100644 index 00000000..31be64c2 --- /dev/null +++ b/chapter06/docs/06-graph2-post.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter06/docs/06-graph2-post.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": null}, + {"id": 13, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 17, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter06/docs/06-graph2-post.svg b/chapter06/docs/06-graph2-post.svg index 269eb15c..db95f198 100644 --- a/chapter06/docs/06-graph2-post.svg +++ b/chapter06/docs/06-graph2-post.svg @@ -1,67 +1,80 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter06 Pages: 1 --> -<svg width="178pt" height="248pt" - viewBox="0.00 0.00 178.00 248.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 244)"> -<title>chapter06</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-244 174,-244 174,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-232 162,-232 162,-8 8,-8"/> -</g> -<!-- Return17 --> -<g id="node1" class="node"> -<title>Return17</title> -<polygon fill="yellow" stroke="black" points="118,-124 52,-124 52,-88 118,-88 118,-124"/> -<text text-anchor="middle" x="85" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Start2 --> -<g id="node2" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="24,-195 24,-220 74,-220 74,-195 24,-195"/> -<polygon fill="none" stroke="black" points="24,-195 24,-220 74,-220 74,-195 24,-195"/> -<text text-anchor="start" x="30.5" y="-203.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="24,-164 24,-195 74,-195 74,-164 24,-164"/> -<polygon fill="yellow" stroke="transparent" points="29,-169 29,-190 69,-190 69,-169 29,-169"/> -<polygon fill="none" stroke="black" points="29,-169 29,-190 69,-190 69,-169 29,-169"/> -<text text-anchor="start" x="32" y="-175.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Return17->Start2 --> -<g id="edge1" class="edge"> -<title>Return17->Start2:p0</title> -<path fill="none" stroke="red" d="M68.26,-124.13C60.77,-133.26 52.99,-145.23 50.13,-158.06"/> -<polygon fill="red" stroke="red" points="46.66,-157.67 49,-168 53.61,-158.46 46.66,-157.67"/> -<text text-anchor="middle" x="65.26" y="-126.73" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_13 --> -<g id="node4" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="127" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="127" y="-188.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Return17->Con_13 --> -<g id="edge2" class="edge"> -<title>Return17->Con_13</title> -<path fill="none" stroke="black" d="M93.7,-124.4C99.66,-136.31 107.65,-152.3 114.31,-165.62"/> -<polygon fill="black" stroke="black" points="111.28,-167.38 118.88,-174.76 117.54,-164.25 111.28,-167.38"/> -<text text-anchor="middle" x="90.7" y="-127" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="112,-52 58,-52 58,-16 112,-16 112,-52"/> -<text text-anchor="middle" x="85" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Stop3->Return17 --> -<g id="edge3" class="edge"> -<title>Stop3->Return17</title> -<path fill="none" stroke="red" d="M85,-52.3C85,-60.02 85,-69.29 85,-77.89"/> -<polygon fill="red" stroke="red" points="81.5,-77.9 85,-87.9 88.5,-77.9 81.5,-77.9"/> -<text text-anchor="middle" x="82" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="326" height="320" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 326 320" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #17 · CTRL</title></path><path class="edge CTRL" id="e17i0" d="M84,118 L84,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[0] → #1 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M242,118 L242,128 L124,128 L124,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #13 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(127,270)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #17 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n13" data-id="13" transform="translate(182,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #2 +Type not computed + +</title></g><g class="node" id="n17" data-id="17" transform="translate(44,172)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 Return +Type not computed + +[0] → #1 CTRL +[1] → #13 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter06/docs/06-graph2-pre.json b/chapter06/docs/06-graph2-pre.json new file mode 100644 index 00000000..fd187946 --- /dev/null +++ b/chapter06/docs/06-graph2-pre.json @@ -0,0 +1,24 @@ +{ + "ver": 1, + "comp": "chapter06/docs/06-graph2-pre.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}], "proj": {"par": 8, "idx": 0}}, + {"id": 5, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}], "proj": {"par": 8, "idx": 1}}, + {"id": 7, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 13, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 15, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 14, "role": "ASSOC", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 14, "role": "CTRL", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [4, 5, 8, 14, 15]} + ] +} diff --git a/chapter06/docs/06-graph2-pre.svg b/chapter06/docs/06-graph2-pre.svg index e9a4dd55..bbc372f3 100644 --- a/chapter06/docs/06-graph2-pre.svg +++ b/chapter06/docs/06-graph2-pre.svg @@ -1,154 +1,108 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter06 Pages: 1 --> -<svg width="294pt" height="420pt" - viewBox="0.00 0.00 294.00 420.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 416)"> -<title>chapter06</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-416 290,-416 290,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-404 278,-404 278,-8 8,-8"/> -</g> -<!-- Return16 --> -<g id="node1" class="node"> -<title>Return16</title> -<polygon fill="yellow" stroke="black" points="187,-124 121,-124 121,-88 187,-88 187,-124"/> -<text text-anchor="middle" x="154" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Region14 --> -<g id="node8" class="node"> -<title>Region14</title> -<polygon fill="yellow" stroke="black" points="226,-196 160,-196 160,-160 226,-160 226,-196"/> -<text text-anchor="middle" x="193" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Return16->Region14 --> -<g id="edge1" class="edge"> -<title>Return16->Region14</title> -<path fill="none" stroke="red" d="M163.64,-124.3C168.13,-132.36 173.56,-142.11 178.52,-151.02"/> -<polygon fill="red" stroke="red" points="175.55,-152.86 183.47,-159.9 181.66,-149.46 175.55,-152.86"/> -<text text-anchor="middle" x="160.64" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_a15 --> -<g id="node9" class="node"> -<title>Phi_a15</title> -<ellipse fill="lightyellow" stroke="black" cx="115" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-174.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Return16->Phi_a15 --> -<g id="edge2" class="edge"> -<title>Return16->Phi_a15</title> -<path fill="none" stroke="black" d="M144.36,-124.3C139.69,-132.68 134,-142.9 128.87,-152.1"/> -<polygon fill="black" stroke="black" points="125.8,-150.42 123.99,-160.86 131.92,-153.82 125.8,-150.42"/> -<text text-anchor="middle" x="141.36" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Start2 --> -<g id="node2" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="126,-367 126,-392 176,-392 176,-367 126,-367"/> -<polygon fill="none" stroke="black" points="126,-367 126,-392 176,-392 176,-367 126,-367"/> -<text text-anchor="start" x="132.5" y="-375.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="126,-336 126,-367 176,-367 176,-336 126,-336"/> -<polygon fill="yellow" stroke="transparent" points="131,-341 131,-362 171,-362 171,-341 131,-341"/> -<polygon fill="none" stroke="black" points="131,-341 131,-362 171,-362 171,-341 131,-341"/> -<text text-anchor="start" x="134" y="-347.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="181,-52 127,-52 127,-16 181,-16 181,-52"/> -<text text-anchor="middle" x="154" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Stop3->Return16 --> -<g id="edge3" class="edge"> -<title>Stop3->Return16</title> -<path fill="none" stroke="red" d="M154,-52.3C154,-60.02 154,-69.29 154,-77.89"/> -<polygon fill="red" stroke="red" points="150.5,-77.9 154,-87.9 157.5,-77.9 150.5,-77.9"/> -<text text-anchor="middle" x="151" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_7 --> -<g id="node4" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="229" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="229" y="-360.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- If8 --> -<g id="node5" class="node"> -<title>If8</title> -<polygon fill="yellow" stroke="transparent" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<polygon fill="none" stroke="black" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<text text-anchor="start" x="209.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="168,-236 168,-267 262,-267 262,-236 168,-236"/> -<polygon fill="yellow" stroke="transparent" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<polygon fill="none" stroke="black" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<text text-anchor="start" x="176" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<polygon fill="none" stroke="black" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<text text-anchor="start" x="216" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If8->Start2 --> -<g id="edge4" class="edge"> -<title>If8->Start2:p0</title> -<path fill="none" stroke="red" d="M205.76,-296.05C199.47,-314.72 190.61,-336.65 181.17,-346.18"/> -<polygon fill="red" stroke="red" points="179.22,-343.25 172,-351 182.48,-349.44 179.22,-343.25"/> -<text text-anchor="middle" x="202.76" y="-298.65" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If8->Con_7 --> -<g id="edge5" class="edge"> -<title>If8->Con_7</title> -<path fill="none" stroke="black" d="M219.43,-296.01C221.25,-308.76 223.34,-323.4 225.1,-335.73"/> -<polygon fill="black" stroke="black" points="221.67,-336.47 226.55,-345.87 228.6,-335.48 221.67,-336.47"/> -<text text-anchor="middle" x="216.43" y="-298.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_12 --> -<g id="node6" class="node"> -<title>Con_12</title> -<ellipse fill="none" stroke="black" cx="43" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-260.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_13 --> -<g id="node7" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="115" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-260.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Region14->If8 --> -<g id="edge6" class="edge"> -<title>Region14->If8:p0</title> -<path fill="none" stroke="red" d="M193,-196.09C193,-205.55 193,-217.77 193,-229.69"/> -<polygon fill="red" stroke="red" points="189.5,-230 193,-240 196.5,-230 189.5,-230"/> -<text text-anchor="middle" x="190" y="-198.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region14->If8 --> -<g id="edge7" class="edge"> -<title>Region14->If8:p1</title> -<path fill="none" stroke="red" d="M213.02,-196.12C221.64,-205.06 230.48,-216.84 233.71,-229.84"/> -<polygon fill="red" stroke="red" points="230.27,-230.52 235,-240 237.22,-229.64 230.27,-230.52"/> -<text text-anchor="middle" x="210.02" y="-198.72" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a15->Con_12 --> -<g id="edge9" class="edge"> -<title>Phi_a15->Con_12</title> -<path fill="none" stroke="black" d="M102.13,-194.02C91.07,-206.92 74.96,-225.71 62.35,-240.42"/> -<polygon fill="black" stroke="black" points="59.61,-238.24 55.76,-248.11 64.93,-242.8 59.61,-238.24"/> -<text text-anchor="middle" x="99.13" y="-196.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a15->Con_13 --> -<g id="edge10" class="edge"> -<title>Phi_a15->Con_13</title> -<path fill="none" stroke="black" d="M115,-196.4C115,-207.74 115,-222.77 115,-235.68"/> -<polygon fill="black" stroke="black" points="111.5,-235.9 115,-245.9 118.5,-235.9 111.5,-235.9"/> -<text text-anchor="middle" x="112" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a15->Region14 --> -<g id="edge8" class="edge"> -<title>Phi_a15->Region14</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M142.12,-178C144.58,-178 147.04,-178 149.5,-178"/> -<polygon fill="black" stroke="black" points="149.61,-181.5 159.61,-178 149.61,-174.5 149.61,-181.5"/> -<text text-anchor="middle" x="145.12" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="662" height="628" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 662 628" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,527 C180,551 331,554 331,578" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #16 · CTRL</title></path><path class="edge CTRL" id="e8i0" d="M116,118 L116,205" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[0] → #1 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M274,118 L274,128 L196,128 L196,205" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #7 · DATA</title></path><path class="edge CTRL" id="e14i1" d="M96,305 L96,315 L160,315 L160,353" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[1] → #4 · CTRL</title></path><path class="edge CTRL" id="e14i2" d="M216,305 L216,315 L190,315 L190,353" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[2] → #5 · CTRL</title></path><path class="edge DATA" id="e15i1" d="M426,118 L426,128 L292,128 L292,353" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#15[1] → #12 · DATA</title></path><path class="edge DATA" id="e15i2" d="M578,118 L578,138 L332,138 L332,353" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#15[2] → #13 · DATA</title></path><path class="edge CTRL" id="e16i0" d="M160,409 L160,474" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #14 · CTRL</title></path><path class="edge DATA" id="e16i1" d="M312,409 L312,436 L200,436 L200,474" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #15 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(56,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(56,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(295,578)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #16 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(36,255)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 True +Projection 0 of #8 +Type not computed + +[0] → #8 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(156,255)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #5/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 False +Projection 1 of #8 +Type not computed + +[0] → #8 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(214,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #1 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(36,211)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#8 If +Type not computed + +[0] → #1 CTRL +[1] → #7 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n12" data-id="12" transform="translate(366,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 #2 +Type not computed + +</title></g><g class="node" id="n13" data-id="13" transform="translate(518,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 #3 +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(100,359)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 Region +Type not computed + +[0] → — DATA +[1] → #4 CTRL +[2] → #5 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(252,359)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 φ_a +Type not computed + +[0] → #14 ASSOC +[1] → #12 DATA +[2] → #13 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #14</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n16" data-id="16" transform="translate(120,480)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 Return +Type not computed + +[0] → #14 CTRL +[1] → #15 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,171)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #8</tspan></text><title>If · 5 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter06/docs/06-graph3-nonconst-peephole.json b/chapter06/docs/06-graph3-nonconst-peephole.json new file mode 100644 index 00000000..7f1f183c --- /dev/null +++ b/chapter06/docs/06-graph3-nonconst-peephole.json @@ -0,0 +1,24 @@ +{ + "ver": 1, + "comp": "chapter06/docs/06-graph3-nonconst-peephole.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 31, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}], "proj": {"par": 8, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}], "proj": {"par": 8, "idx": 1}}, + {"id": 8, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 6, "role": "CTRL", "label": null}], "proj": null}, + {"id": 27, "label": "#4", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 29, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 30, "label": "φ_ab", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 22, "role": "ASSOC", "label": null}, {"idx": 1, "def": 27, "role": "DATA", "label": null}, {"idx": 2, "def": 29, "role": "DATA", "label": null}], "proj": null}, + {"id": 31, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 22, "role": "CTRL", "label": null}, {"idx": 1, "def": 30, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [5, 6, 8, 22, 30]} + ] +} diff --git a/chapter06/docs/06-graph3-nonconst-peephole.svg b/chapter06/docs/06-graph3-nonconst-peephole.svg index c312ffc5..85728510 100644 --- a/chapter06/docs/06-graph3-nonconst-peephole.svg +++ b/chapter06/docs/06-graph3-nonconst-peephole.svg @@ -1,150 +1,109 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter06 Pages: 1 --> -<svg width="294pt" height="420pt" - viewBox="0.00 0.00 294.00 420.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 416)"> -<title>chapter06</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-416 290,-416 290,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-404 278,-404 278,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="168,-367 168,-392 249,-392 249,-367 168,-367"/> -<polygon fill="none" stroke="black" points="168,-367 168,-392 249,-392 249,-367 168,-367"/> -<text text-anchor="start" x="190" y="-375.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="168,-336 168,-367 249,-367 249,-336 168,-336"/> -<polygon fill="yellow" stroke="transparent" points="173,-341 173,-362 213,-362 213,-341 173,-341"/> -<polygon fill="none" stroke="black" points="173,-341 173,-362 213,-362 213,-341 173,-341"/> -<text text-anchor="start" x="176" y="-347.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="213,-341 213,-362 244,-362 244,-341 213,-341"/> -<text text-anchor="start" x="216" y="-347.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="180,-52 126,-52 126,-16 180,-16 180,-52"/> -<text text-anchor="middle" x="153" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return31 --> -<g id="node8" class="node"> -<title>Return31</title> -<polygon fill="yellow" stroke="black" points="186,-124 120,-124 120,-88 186,-88 186,-124"/> -<text text-anchor="middle" x="153" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return31 --> -<g id="edge1" class="edge"> -<title>Stop3->Return31</title> -<path fill="none" stroke="red" d="M153,-52.3C153,-60.02 153,-69.29 153,-77.89"/> -<polygon fill="red" stroke="red" points="149.5,-77.9 153,-87.9 156.5,-77.9 149.5,-77.9"/> -<text text-anchor="middle" x="150" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Region22 --> -<g id="node3" class="node"> -<title>Region22</title> -<polygon fill="yellow" stroke="black" points="228,-196 162,-196 162,-160 228,-160 228,-196"/> -<text text-anchor="middle" x="195" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- If8 --> -<g id="node4" class="node"> -<title>If8</title> -<polygon fill="yellow" stroke="transparent" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<polygon fill="none" stroke="black" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<text text-anchor="start" x="209.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="168,-236 168,-267 262,-267 262,-236 168,-236"/> -<polygon fill="yellow" stroke="transparent" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<polygon fill="none" stroke="black" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<text text-anchor="start" x="176" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<polygon fill="none" stroke="black" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<text text-anchor="start" x="216" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- Region22->If8 --> -<g id="edge2" class="edge"> -<title>Region22->If8:p0</title> -<path fill="none" stroke="red" d="M194.14,-196.09C193.72,-205.54 193.27,-217.77 193.08,-229.68"/> -<polygon fill="red" stroke="red" points="189.58,-229.97 193,-240 196.58,-230.03 189.58,-229.97"/> -<text text-anchor="middle" x="191.14" y="-198.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region22->If8 --> -<g id="edge3" class="edge"> -<title>Region22->If8:p1</title> -<path fill="none" stroke="red" d="M213.83,-196.05C222.1,-205.05 230.63,-216.92 233.76,-229.89"/> -<polygon fill="red" stroke="red" points="230.31,-230.5 235,-240 237.25,-229.65 230.31,-230.5"/> -<text text-anchor="middle" x="210.83" y="-198.65" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If8->Start2 --> -<g id="edge4" class="edge"> -<title>If8->Start2:p0</title> -<path fill="none" stroke="red" d="M201.57,-296.16C198.03,-306.41 194.84,-318.18 193.57,-329.83"/> -<polygon fill="red" stroke="red" points="190.07,-329.82 193,-340 197.06,-330.21 190.07,-329.82"/> -<text text-anchor="middle" x="198.57" y="-298.76" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If8->Start2 --> -<g id="edge5" class="edge"> -<title>If8->Start2:p1</title> -<path fill="none" stroke="black" d="M223.47,-296.14C225.75,-306.5 227.81,-318.36 228.63,-329.94"/> -<polygon fill="black" stroke="black" points="225.13,-330.14 229,-340 232.13,-329.88 225.13,-330.14"/> -<text text-anchor="middle" x="220.47" y="-298.74" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_27 --> -<g id="node5" class="node"> -<title>Con_27</title> -<ellipse fill="none" stroke="black" cx="43" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-260.3" font-family="Times,serif" font-size="14.00">#4</text> -</g> -<!-- Con_29 --> -<g id="node6" class="node"> -<title>Con_29</title> -<ellipse fill="none" stroke="black" cx="115" cy="-264" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-260.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Phi_ab30 --> -<g id="node7" class="node"> -<title>Phi_ab30</title> -<ellipse fill="lightyellow" stroke="black" cx="112" cy="-178" rx="32.49" ry="18"/> -<text text-anchor="middle" x="112" y="-174.3" font-family="Times,serif" font-size="14.00">φ_ab</text> -</g> -<!-- Phi_ab30->Region22 --> -<g id="edge6" class="edge"> -<title>Phi_ab30->Region22</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M144.75,-178C147.03,-178 149.32,-178 151.6,-178"/> -<polygon fill="black" stroke="black" points="151.63,-181.5 161.63,-178 151.63,-174.5 151.63,-181.5"/> -<text text-anchor="middle" x="147.75" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_ab30->Con_27 --> -<g id="edge7" class="edge"> -<title>Phi_ab30->Con_27</title> -<path fill="none" stroke="black" d="M99.02,-194.8C88.58,-207.51 73.76,-225.56 61.98,-239.89"/> -<polygon fill="black" stroke="black" points="59.1,-237.89 55.46,-247.84 64.51,-242.33 59.1,-237.89"/> -<text text-anchor="middle" x="96.02" y="-197.4" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_ab30->Con_29 --> -<g id="edge8" class="edge"> -<title>Phi_ab30->Con_29</title> -<path fill="none" stroke="black" d="M112.61,-196C113.01,-207.31 113.55,-222.42 114.02,-235.43"/> -<polygon fill="black" stroke="black" points="110.53,-235.87 114.38,-245.74 117.52,-235.62 110.53,-235.87"/> -<text text-anchor="middle" x="109.61" y="-198.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return31->Region22 --> -<g id="edge9" class="edge"> -<title>Return31->Region22</title> -<path fill="none" stroke="red" d="M163.38,-124.3C168.26,-132.44 174.19,-142.31 179.58,-151.3"/> -<polygon fill="red" stroke="red" points="176.59,-153.12 184.74,-159.9 182.59,-149.52 176.59,-153.12"/> -<text text-anchor="middle" x="160.38" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return31->Phi_ab30 --> -<g id="edge10" class="edge"> -<title>Return31->Phi_ab30</title> -<path fill="none" stroke="black" d="M142.87,-124.3C138.03,-132.56 132.15,-142.61 126.82,-151.7"/> -<polygon fill="black" stroke="black" points="123.77,-149.98 121.74,-160.38 129.81,-153.52 123.77,-149.98"/> -<text text-anchor="middle" x="139.87" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="630" height="628" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 630 628" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,527 C180,551 315,554 315,578" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #31 · CTRL</title></path><path class="edge CTRL" id="e8i0" d="M116,118 L116,205" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[0] → #1 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M236,118 L236,128 L196,128 L196,205" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge CTRL" id="e22i1" d="M96,305 L96,315 L160,315 L160,353" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#22[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e22i2" d="M216,305 L216,315 L190,315 L190,353" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#22[2] → #6 · CTRL</title></path><path class="edge DATA" id="e30i1" d="M394,118 L394,128 L292,128 L292,353" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#30[1] → #27 · DATA</title></path><path class="edge DATA" id="e30i2" d="M546,118 L546,138 L332,138 L332,353" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#30[2] → #29 · DATA</title></path><path class="edge CTRL" id="e31i0" d="M160,409 L160,474" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[0] → #22 · CTRL</title></path><path class="edge DATA" id="e31i1" d="M312,409 L312,436 L200,436 L200,474" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[1] → #30 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(56,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(56,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(279,578)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #31 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(36,255)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #8 +Type not computed + +[0] → #8 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(156,255)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #8 +Type not computed + +[0] → #8 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(36,211)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#8 If +Type not computed + +[0] → #1 CTRL +[1] → #4 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n22" data-id="22" transform="translate(100,359)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 Region +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #6 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n27" data-id="27" transform="translate(334,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#4</tspan><tspan class="node-id">  #27</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#27 #4 +Type not computed + +</title></g><g class="node" id="n29" data-id="29" transform="translate(486,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #29</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#29 #1 +Type not computed + +</title></g><g class="node" id="n30" data-id="30" transform="translate(252,359)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_ab</tspan><tspan class="node-id">  #30</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#30 φ_ab +Type not computed + +[0] → #22 ASSOC +[1] → #27 DATA +[2] → #29 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #22</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n31" data-id="31" transform="translate(120,480)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #31</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#31 Return +Type not computed + +[0] → #22 CTRL +[1] → #30 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,171)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #8</tspan></text><title>If · 5 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter06/docs/06-graph3-nonconst.json b/chapter06/docs/06-graph3-nonconst.json new file mode 100644 index 00000000..77bb6d2c --- /dev/null +++ b/chapter06/docs/06-graph3-nonconst.json @@ -0,0 +1,35 @@ +{ + "ver": 1, + "comp": "chapter06/docs/06-graph3-nonconst.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}], "proj": {"par": 8, "idx": 0}}, + {"id": 6, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}], "proj": {"par": 8, "idx": 1}}, + {"id": 10, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 13, "role": "CTRL", "label": null}], "proj": {"par": 13, "idx": 0}}, + {"id": 11, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 13, "role": "CTRL", "label": null}], "proj": {"par": 13, "idx": 1}}, + {"id": 12, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 13, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 18, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 19, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 10, "role": "CTRL", "label": null}, {"idx": 2, "def": 11, "role": "CTRL", "label": null}], "proj": null}, + {"id": 20, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 19, "role": "ASSOC", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}, {"idx": 2, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 19, "role": "CTRL", "label": null}, {"idx": 2, "def": 9, "role": "CTRL", "label": null}], "proj": null}, + {"id": 22, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 21, "role": "ASSOC", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 23, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 21, "role": "ASSOC", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 23, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}, {"idx": 1, "def": 24, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [5, 8, 9, 21, 22, 23, 24]}, + {"id": 13, "par": 8, "nodes": [10, 11, 13, 19, 20]} + ] +} diff --git a/chapter06/docs/06-graph3-nonconst.svg b/chapter06/docs/06-graph3-nonconst.svg index dee852e4..d46d4bb1 100644 --- a/chapter06/docs/06-graph3-nonconst.svg +++ b/chapter06/docs/06-graph3-nonconst.svg @@ -1,290 +1,150 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter06 Pages: 1 --> -<svg width="414pt" height="664pt" - viewBox="0.00 0.00 414.00 664.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 660)"> -<title>chapter06</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-660 410,-660 410,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-648 398,-648 398,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="274,-611 274,-636 355,-636 355,-611 274,-611"/> -<polygon fill="none" stroke="black" points="274,-611 274,-636 355,-636 355,-611 274,-611"/> -<text text-anchor="start" x="296" y="-619.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="274,-580 274,-611 355,-611 355,-580 274,-580"/> -<polygon fill="yellow" stroke="transparent" points="279,-585 279,-606 319,-606 319,-585 279,-585"/> -<polygon fill="none" stroke="black" points="279,-585 279,-606 319,-606 319,-585 279,-585"/> -<text text-anchor="start" x="282" y="-591.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="319,-585 319,-606 350,-606 350,-585 319,-585"/> -<text text-anchor="start" x="322" y="-591.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="299,-52 245,-52 245,-16 299,-16 299,-52"/> -<text text-anchor="middle" x="272" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return25 --> -<g id="node16" class="node"> -<title>Return25</title> -<polygon fill="yellow" stroke="black" points="305,-124 239,-124 239,-88 305,-88 305,-124"/> -<text text-anchor="middle" x="272" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return25 --> -<g id="edge1" class="edge"> -<title>Stop3->Return25</title> -<path fill="none" stroke="red" d="M272,-52.3C272,-60.02 272,-69.29 272,-77.89"/> -<polygon fill="red" stroke="red" points="268.5,-77.9 272,-87.9 275.5,-77.9 268.5,-77.9"/> -<text text-anchor="middle" x="269" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="259" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="259" y="-318.3" font-family="Times,serif" font-size="14.00">#0</text> -</g> -<!-- Con_7 --> -<g id="node4" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="115" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-318.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- If8 --> -<g id="node5" class="node"> -<title>If8</title> -<polygon fill="yellow" stroke="transparent" points="288,-511 288,-536 382,-536 382,-511 288,-511"/> -<polygon fill="none" stroke="black" points="288,-511 288,-536 382,-536 382,-511 288,-511"/> -<text text-anchor="start" x="329.5" y="-519.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="288,-480 288,-511 382,-511 382,-480 288,-480"/> -<polygon fill="yellow" stroke="transparent" points="293,-485 293,-506 333,-506 333,-485 293,-485"/> -<polygon fill="none" stroke="black" points="293,-485 293,-506 333,-506 333,-485 293,-485"/> -<text text-anchor="start" x="296" y="-491.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="333,-485 333,-506 377,-506 377,-485 333,-485"/> -<polygon fill="none" stroke="black" points="333,-485 333,-506 377,-506 377,-485 333,-485"/> -<text text-anchor="start" x="336" y="-491.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If8->Start2 --> -<g id="edge2" class="edge"> -<title>If8->Start2:p0</title> -<path fill="none" stroke="red" d="M312.41,-540.3C306.75,-550.38 301.75,-562.04 299.83,-573.96"/> -<polygon fill="red" stroke="red" points="296.34,-573.75 299,-584 303.31,-574.32 296.34,-573.75"/> -<text text-anchor="middle" x="309.41" y="-542.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If8->Start2 --> -<g id="edge3" class="edge"> -<title>If8->Start2:p1</title> -<path fill="none" stroke="black" d="M335,-540.02C335,-550.47 335,-562.42 335,-573.98"/> -<polygon fill="black" stroke="black" points="331.5,-574 335,-584 338.5,-574 331.5,-574"/> -<text text-anchor="middle" x="332" y="-542.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_12 --> -<g id="node6" class="node"> -<title>Con_12</title> -<ellipse fill="none" stroke="black" cx="187" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="187" y="-318.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- If13 --> -<g id="node7" class="node"> -<title>If13</title> -<polygon fill="yellow" stroke="transparent" points="267,-411 267,-436 361,-436 361,-411 267,-411"/> -<polygon fill="none" stroke="black" points="267,-411 267,-436 361,-436 361,-411 267,-411"/> -<text text-anchor="start" x="308.5" y="-419.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="267,-380 267,-411 361,-411 361,-380 267,-380"/> -<polygon fill="yellow" stroke="transparent" points="272,-385 272,-406 312,-406 312,-385 272,-385"/> -<polygon fill="none" stroke="black" points="272,-385 272,-406 312,-406 312,-385 272,-385"/> -<text text-anchor="start" x="275" y="-391.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="312,-385 312,-406 356,-406 356,-385 312,-385"/> -<polygon fill="none" stroke="black" points="312,-385 312,-406 356,-406 356,-385 312,-385"/> -<text text-anchor="start" x="315" y="-391.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If13->Start2 --> -<g id="edge5" class="edge"> -<title>If13->Start2:p1</title> -<path fill="none" stroke="black" d="M288.75,-440.22C281.57,-450.93 274.7,-463.4 271,-476 262.99,-503.29 257.76,-514.83 271,-540 285.19,-566.97 324.2,-553.71 333.15,-573.98"/> -<polygon fill="black" stroke="black" points="329.75,-574.8 335,-584 336.63,-573.53 329.75,-574.8"/> -<text text-anchor="middle" x="285.75" y="-442.82" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If13->If8 --> -<g id="edge4" class="edge"> -<title>If13->If8:p0</title> -<path fill="none" stroke="red" d="M313.4,-440.02C313.24,-450.46 313.09,-462.42 313.03,-473.98"/> -<polygon fill="red" stroke="red" points="309.53,-473.99 313,-484 316.53,-474.01 309.53,-473.99"/> -<text text-anchor="middle" x="310.4" y="-442.62" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_17 --> -<g id="node8" class="node"> -<title>Con_17</title> -<ellipse fill="none" stroke="black" cx="43" cy="-408" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-404.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Con_18 --> -<g id="node9" class="node"> -<title>Con_18</title> -<ellipse fill="none" stroke="black" cx="115" cy="-408" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-404.3" font-family="Times,serif" font-size="14.00">#3</text> -</g> -<!-- Region19 --> -<g id="node10" class="node"> -<title>Region19</title> -<polygon fill="yellow" stroke="black" points="370,-340 304,-340 304,-304 370,-304 370,-340"/> -<text text-anchor="middle" x="337" y="-318.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region19->If13 --> -<g id="edge6" class="edge"> -<title>Region19->If13:p0</title> -<path fill="none" stroke="red" d="M315.29,-340.1C306.12,-348.94 296.78,-360.62 293.36,-373.72"/> -<polygon fill="red" stroke="red" points="289.84,-373.63 292,-384 296.78,-374.54 289.84,-373.63"/> -<text text-anchor="middle" x="312.29" y="-342.7" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region19->If13 --> -<g id="edge7" class="edge"> -<title>Region19->If13:p1</title> -<path fill="none" stroke="red" d="M335.71,-340.08C335.08,-349.53 334.4,-361.76 334.13,-373.68"/> -<polygon fill="red" stroke="red" points="330.62,-373.96 334,-384 337.62,-374.04 330.62,-373.96"/> -<text text-anchor="middle" x="332.71" y="-342.68" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_b20 --> -<g id="node11" class="node"> -<title>Phi_b20</title> -<ellipse fill="lightyellow" stroke="black" cx="43" cy="-322" rx="27.1" ry="18"/> -<text text-anchor="middle" x="43" y="-318.3" font-family="Times,serif" font-size="14.00">φ_b</text> -</g> -<!-- Phi_b20->Con_17 --> -<g id="edge9" class="edge"> -<title>Phi_b20->Con_17</title> -<path fill="none" stroke="black" d="M43,-340.4C43,-351.74 43,-366.77 43,-379.68"/> -<polygon fill="black" stroke="black" points="39.5,-379.9 43,-389.9 46.5,-379.9 39.5,-379.9"/> -<text text-anchor="middle" x="40" y="-343" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_b20->Con_18 --> -<g id="edge10" class="edge"> -<title>Phi_b20->Con_18</title> -<path fill="none" stroke="black" d="M55.87,-338.02C66.93,-350.92 83.04,-369.71 95.65,-384.42"/> -<polygon fill="black" stroke="black" points="93.07,-386.8 102.24,-392.11 98.39,-382.24 93.07,-386.8"/> -<text text-anchor="middle" x="52.87" y="-340.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_b20->Region19 --> -<g id="edge8" class="edge"> -<title>Phi_b20->Region19</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M57.22,-306.43C65.37,-298.68 76.29,-290.11 88,-286 129.52,-271.44 244.06,-272.69 286,-286 293.99,-288.54 301.81,-292.83 308.83,-297.58"/> -<polygon fill="black" stroke="black" points="307.11,-300.66 317.24,-303.75 311.25,-295.01 307.11,-300.66"/> -<text text-anchor="middle" x="54.22" y="-300.03" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Region21 --> -<g id="node12" class="node"> -<title>Region21</title> -<polygon fill="yellow" stroke="black" points="352,-268 286,-268 286,-232 352,-232 352,-268"/> -<text text-anchor="middle" x="319" y="-246.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region21->If8 --> -<g id="edge12" class="edge"> -<title>Region21->If8:p1</title> -<path fill="none" stroke="red" d="M347.26,-268.03C359.43,-277.04 372.37,-289.3 379,-304 385.58,-318.6 394.79,-373.07 378,-440 373.59,-457.56 360.94,-461.07 356.53,-473.94"/> -<polygon fill="red" stroke="red" points="353.05,-473.59 355,-484 359.97,-474.64 353.05,-473.59"/> -<text text-anchor="middle" x="344.26" y="-270.63" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region21->Region19 --> -<g id="edge11" class="edge"> -<title>Region21->Region19</title> -<path fill="none" stroke="red" d="M323.45,-268.3C325.45,-276.1 327.87,-285.49 330.1,-294.17"/> -<polygon fill="red" stroke="red" points="326.72,-295.08 332.6,-303.9 333.5,-293.34 326.72,-295.08"/> -<text text-anchor="middle" x="320.45" y="-270.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a22 --> -<g id="node13" class="node"> -<title>Phi_a22</title> -<ellipse fill="lightyellow" stroke="black" cx="241" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="241" y="-246.3" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a22->Con_6 --> -<g id="edge15" class="edge"> -<title>Phi_a22->Con_6</title> -<path fill="none" stroke="black" d="M245.36,-267.95C247.39,-275.86 249.86,-285.46 252.14,-294.31"/> -<polygon fill="black" stroke="black" points="248.8,-295.4 254.68,-304.21 255.58,-293.65 248.8,-295.4"/> -<text text-anchor="middle" x="242.36" y="-270.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a22->Con_12 --> -<g id="edge14" class="edge"> -<title>Phi_a22->Con_12</title> -<path fill="none" stroke="black" d="M229.02,-266.54C222.02,-275.6 213.06,-287.21 205.21,-297.39"/> -<polygon fill="black" stroke="black" points="202.29,-295.45 198.95,-305.51 207.83,-299.73 202.29,-295.45"/> -<text text-anchor="middle" x="226.02" y="-269.14" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a22->Region21 --> -<g id="edge13" class="edge"> -<title>Phi_a22->Region21</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M268.12,-250C270.58,-250 273.04,-250 275.5,-250"/> -<polygon fill="black" stroke="black" points="275.61,-253.5 285.61,-250 275.61,-246.5 275.61,-253.5"/> -<text text-anchor="middle" x="271.12" y="-243.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_b23 --> -<g id="node14" class="node"> -<title>Phi_b23</title> -<ellipse fill="lightyellow" stroke="black" cx="133" cy="-250" rx="27.1" ry="18"/> -<text text-anchor="middle" x="133" y="-246.3" font-family="Times,serif" font-size="14.00">φ_b</text> -</g> -<!-- Phi_b23->Con_7 --> -<g id="edge18" class="edge"> -<title>Phi_b23->Con_7</title> -<path fill="none" stroke="black" d="M128.64,-267.95C126.61,-275.86 124.14,-285.46 121.86,-294.31"/> -<polygon fill="black" stroke="black" points="118.42,-293.65 119.32,-304.21 125.2,-295.4 118.42,-293.65"/> -<text text-anchor="middle" x="125.64" y="-270.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_b23->Phi_b20 --> -<g id="edge17" class="edge"> -<title>Phi_b23->Phi_b20</title> -<path fill="none" stroke="black" d="M116.07,-264.17C102.58,-274.66 83.49,-289.51 68.2,-301.4"/> -<polygon fill="black" stroke="black" points="65.9,-298.75 60.16,-307.65 70.2,-304.28 65.9,-298.75"/> -<text text-anchor="middle" x="113.07" y="-266.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_b23->Region21 --> -<g id="edge16" class="edge"> -<title>Phi_b23->Region21</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M152.84,-237.61C179.31,-222.7 227.54,-201.16 268,-214 275.99,-216.54 283.81,-220.83 290.83,-225.58"/> -<polygon fill="black" stroke="black" points="289.11,-228.66 299.24,-231.75 293.25,-223.01 289.11,-228.66"/> -<text text-anchor="middle" x="149.84" y="-231.21" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add24 --> -<g id="node15" class="node"> -<title>Add24</title> -<ellipse fill="none" stroke="black" cx="241" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="241" y="-174.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add24->Phi_a22 --> -<g id="edge20" class="edge"> -<title>Add24->Phi_a22</title> -<path fill="none" stroke="black" d="M241,-196.3C241,-204.02 241,-213.29 241,-221.89"/> -<polygon fill="black" stroke="black" points="237.5,-221.9 241,-231.9 244.5,-221.9 237.5,-221.9"/> -<text text-anchor="middle" x="238" y="-198.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add24->Phi_b23 --> -<g id="edge19" class="edge"> -<title>Add24->Phi_b23</title> -<path fill="none" stroke="black" d="M222.19,-191.19C205.1,-202.27 179.69,-218.74 160.36,-231.27"/> -<polygon fill="black" stroke="black" points="158.45,-228.34 151.96,-236.71 162.25,-234.21 158.45,-228.34"/> -<text text-anchor="middle" x="219.19" y="-193.79" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return25->Region21 --> -<g id="edge21" class="edge"> -<title>Return25->Region21</title> -<path fill="none" stroke="red" d="M277.67,-124.13C285.71,-148.44 300.52,-193.18 310.06,-221.99"/> -<polygon fill="red" stroke="red" points="306.85,-223.42 313.31,-231.81 313.49,-221.22 306.85,-223.42"/> -<text text-anchor="middle" x="274.67" y="-126.73" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return25->Add24 --> -<g id="edge22" class="edge"> -<title>Return25->Add24</title> -<path fill="none" stroke="black" d="M264.34,-124.3C260.76,-132.39 256.42,-142.19 252.46,-151.13"/> -<polygon fill="black" stroke="black" points="249.21,-149.82 248.36,-160.38 255.61,-152.65 249.21,-149.82"/> -<text text-anchor="middle" x="261.34" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1086" height="1042" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1086 1042" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="608" height="664" fill="#f2f7ef"/></g><g class="region" transform="translate(227,358)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M206,941 C206,965 543,968 543,992" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #25 · CTRL</title></path><path class="edge CTRL" id="e8i0" d="M116,118 L116,205" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[0] → #1 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M236,118 L236,138 L196,138 L196,205" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge CTRL" id="e13i0" d="M96,305 L96,315 L319,315 L319,392" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#13[0] → #5 · CTRL</title></path><path class="edge DATA" id="e13i1" d="M236,118 L236,138 L399,138 L399,392" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[1] → #4 · DATA</title></path><path class="edge CTRL" id="e19i1" d="M299,492 L299,502 L363,502 L363,540" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[1] → #10 · CTRL</title></path><path class="edge CTRL" id="e19i2" d="M419,492 L419,502 L393,502 L393,540" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[2] → #11 · CTRL</title></path><path class="edge DATA" id="e20i1" d="M394,118 L394,128 L495,128 L495,540" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[1] → #17 · DATA</title></path><path class="edge DATA" id="e20i2" d="M546,118 L546,128 L535,128 L535,540" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[2] → #18 · DATA</title></path><path class="edge CTRL" id="e21i1" d="M363,596 L363,623 L186,623 L186,663" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[1] → #19 · CTRL</title></path><path class="edge CTRL" id="e21i2" d="M216,305 L216,663" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[2] → #9 · CTRL</title></path><path class="edge DATA" id="e22i1" d="M698,118 L698,128 L597,128 L597,633 L318,633 L318,663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[1] → #12 · DATA</title></path><path class="edge DATA" id="e22i2" d="M850,118 L850,138 L608,138 L608,643 L358,643 L358,663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[2] → #6 · DATA</title></path><path class="edge DATA" id="e23i1" d="M515,596 L515,623 L470,623 L470,663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[1] → #20 · DATA</title></path><path class="edge DATA" id="e23i2" d="M1002,118 L1002,148 L619,148 L619,653 L510,653 L510,663" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[2] → #7 · DATA</title></path><path class="edge DATA" id="e24i1" d="M490,719 L490,729 L308,729 L308,767" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[1] → #23 · DATA</title></path><path class="edge DATA" id="e24i2" d="M338,719 L338,767" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[2] → #22 · DATA</title></path><path class="edge CTRL" id="e25i0" d="M186,719 L186,888" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #21 · CTRL</title></path><path class="edge DATA" id="e25i1" d="M308,823 L308,850 L226,850 L226,888" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[1] → #24 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(56,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(56,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(507,992)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #25 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(36,255)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #8 +Type not computed + +[0] → #8 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(790,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #0 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(942,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #1 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(36,211)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#8 If +Type not computed + +[0] → #1 CTRL +[1] → #4 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n9" data-id="9" transform="translate(156,255)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #9/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 False +Projection 1 of #8 +Type not computed + +[0] → #8 CTRL</title></g><g class="node" id="n10" data-id="10" transform="translate(239,442)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #10/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 True +Projection 0 of #13 +Type not computed + +[0] → #13 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(359,442)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #11/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 False +Projection 1 of #13 +Type not computed + +[0] → #13 CTRL</title></g><g class="node" id="n12" data-id="12" transform="translate(638,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 #2 +Type not computed + +</title></g><g class="node" id="n13" data-id="13" transform="translate(239,398)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#13 If +Type not computed + +[0] → #5 CTRL +[1] → #4 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n17" data-id="17" transform="translate(334,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 #2 +Type not computed + +</title></g><g class="node" id="n18" data-id="18" transform="translate(486,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 #3 +Type not computed + +</title></g><g class="node" id="n19" data-id="19" transform="translate(303,546)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 Region +Type not computed + +[0] → — DATA +[1] → #10 CTRL +[2] → #11 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n20" data-id="20" transform="translate(455,546)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_b</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 φ_b +Type not computed + +[0] → #19 ASSOC +[1] → #17 DATA +[2] → #18 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #19</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n21" data-id="21" transform="translate(126,669)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Region +Type not computed + +[0] → — DATA +[1] → #19 CTRL +[2] → #9 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n22" data-id="22" transform="translate(278,669)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 φ_a +Type not computed + +[0] → #21 ASSOC +[1] → #12 DATA +[2] → #6 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #21</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n23" data-id="23" transform="translate(430,669)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_b</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 φ_b +Type not computed + +[0] → #21 ASSOC +[1] → #20 DATA +[2] → #7 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #21</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n24" data-id="24" transform="translate(248,773)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 + +Type not computed + +[0] → — DATA +[1] → #23 DATA +[2] → #22 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n25" data-id="25" transform="translate(146,894)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 Return +Type not computed + +[0] → #21 CTRL +[1] → #24 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,171)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #8</tspan></text><title>If · 12 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(227,358)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #13</tspan></text><title>If · 5 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #13"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter06/docs/Makefile b/chapter06/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter06/docs/Makefile +++ b/chapter06/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter07/README.md b/chapter07/README.md index d701278a..5a49d3ef 100644 --- a/chapter07/README.md +++ b/chapter07/README.md @@ -1,5 +1,8 @@ # Chapter 7: While Statement +[Previous: Chapter 6](../chapter06/README.md) | +[Next: Chapter 8](../chapter08/README.md) + # Table of Contents 1. [Dealing With Back Edges](#dealing-with-back-edges) @@ -7,7 +10,7 @@ 3. [Detailed Steps](#detailed-steps) 4. [Visualization](#visualization) 5. [Nested Loops](#nested-loops) -5. [Loop With Nested If](#loop-with-nested-if) +6. [Loop With Nested If](#loop-with-nested-if) You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter07) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter06...linear-chapter07) it to the previous chapter. @@ -94,7 +97,7 @@ until we complete parsing the loop body. Other nodes continue to optimize normal The newly created region becomes the current control. 2. We duplicate the current Scope node. This involves duplicating all the symbols at - every level with the scope, and creating phis for every symbol except the `$ctrl` binding. + every level within the scope, and creating phis for every symbol except the `$ctrl` binding. ```java // Make a new Scope for the body. @@ -196,7 +199,8 @@ The example quoted above is shown below at an intermediate state:  -* Three Scopes are shown, reading clockwise, the loop head, exit and the body. +* Three Scopes are shown: the loop head, exit, and body. Their `$ctrl` bindings + point to Loop, False, and True, respectively. The final graph looks like this: diff --git a/chapter07/docs/07-graph1.json b/chapter07/docs/07-graph1.json new file mode 100644 index 00000000..0f2c6c4d --- /dev/null +++ b/chapter07/docs/07-graph1.json @@ -0,0 +1,27 @@ +{ + "ver": 1, + "comp": "chapter07/docs/07-graph1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 18, "role": "ASSOC", "label": "3: $ctrl"}, {"idx": 1, "def": 16, "role": "ASSOC", "label": "3: arg"}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 5, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 6, "role": "ASSOC", "label": "2: $ctrl"}, {"idx": 1, "def": 8, "role": "ASSOC", "label": "2: arg"}], "proj": null}, + {"id": 6, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 14, "role": "CTRL", "label": null}], "proj": null}, + {"id": 8, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 6, "role": "ASSOC", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "Scope", "type": null, "kind": "SCOPE", "edges": [{"idx": 0, "def": 19, "role": "ASSOC", "label": "2: $ctrl"}, {"idx": 1, "def": 8, "role": "ASSOC", "label": "2: arg"}], "proj": null}, + {"id": 14, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 15, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 18, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 19, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}} + ], + "groups": [ + {"id": 6, "par": 0, "nodes": [6, 8]} + ] +} diff --git a/chapter07/docs/07-graph1.svg b/chapter07/docs/07-graph1.svg index 94248cfb..e6ee94a4 100644 --- a/chapter07/docs/07-graph1.svg +++ b/chapter07/docs/07-graph1.svg @@ -1,268 +1,122 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter07 Pages: 1 --> -<svg width="726pt" height="440pt" - viewBox="0.00 0.00 726.00 440.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 436)"> -<title>chapter07</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-436 722,-436 722,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="196,-100 196,-424 502,-424 502,-100 196,-100"/> -</g> -<g id="clust3" class="cluster"> -<title>cluster_Scope7_1</title> -<polygon fill="none" stroke="black" points="8,-8 8,-92 288,-92 288,-8 8,-8"/> -</g> -<g id="clust4" class="cluster"> -<title>cluster_Scope7_2</title> -<polygon fill="none" stroke="black" points="80,-16 80,-84 280,-84 280,-16 80,-16"/> -</g> -<g id="clust5" class="cluster"> -<title>cluster_Scope7_3</title> -<polygon fill="none" stroke="black" points="152,-24 152,-76 272,-76 272,-24 152,-24"/> -</g> -<g id="clust6" class="cluster"> -<title>cluster_Scope1_1</title> -<polygon fill="none" stroke="black" points="510,-192 510,-260 710,-260 710,-192 510,-192"/> -</g> -<g id="clust7" class="cluster"> -<title>cluster_Scope1_2</title> -<polygon fill="none" stroke="black" points="582,-200 582,-252 702,-252 702,-200 582,-200"/> -</g> -<g id="clust8" class="cluster"> -<title>cluster_Scope14_1</title> -<polygon fill="none" stroke="black" points="296,-16 296,-84 496,-84 496,-16 296,-16"/> -</g> -<g id="clust9" class="cluster"> -<title>cluster_Scope14_2</title> -<polygon fill="none" stroke="black" points="368,-24 368,-76 488,-76 488,-24 368,-24"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="365,-387 365,-412 446,-412 446,-387 365,-387"/> -<polygon fill="none" stroke="black" points="365,-387 365,-412 446,-412 446,-387 365,-387"/> -<text text-anchor="start" x="387" y="-395.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="365,-356 365,-387 446,-387 446,-356 365,-356"/> -<polygon fill="yellow" stroke="transparent" points="370,-361 370,-382 410,-382 410,-361 370,-361"/> -<polygon fill="none" stroke="black" points="370,-361 370,-382 410,-382 410,-361 370,-361"/> -<text text-anchor="start" x="373" y="-367.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="410,-361 410,-382 441,-382 441,-361 410,-361"/> -<text text-anchor="start" x="413" y="-367.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Loop6 --> -<g id="node2" class="node"> -<title>Loop6</title> -<polygon fill="yellow" stroke="black" points="494,-316 440,-316 440,-280 494,-280 494,-316"/> -<text text-anchor="middle" x="467" y="-294.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop6->Start2 --> -<g id="edge1" class="edge"> -<title>Loop6->Start2:p0</title> -<path fill="none" stroke="red" d="M439.64,-314.34C422.52,-324.68 402.19,-338.54 393.85,-350.32"/> -<polygon fill="red" stroke="red" points="390.45,-349.41 390,-360 396.95,-352 390.45,-349.41"/> -<text text-anchor="middle" x="436.64" y="-307.94" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg8 --> -<g id="node3" class="node"> -<title>Phi_arg8</title> -<ellipse fill="lightyellow" stroke="black" cx="385" cy="-298" rx="37.09" ry="18"/> -<text text-anchor="middle" x="385" y="-294.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg8->Start2 --> -<g id="edge3" class="edge"> -<title>Phi_arg8->Start2:p1</title> -<path fill="none" stroke="black" d="M402.63,-314.22C411.57,-323.35 421.25,-335.86 424.7,-349.71"/> -<polygon fill="black" stroke="black" points="421.27,-350.52 426,-360 428.22,-349.64 421.27,-350.52"/> -<text text-anchor="middle" x="399.63" y="-316.82" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg8->Loop6 --> -<g id="edge2" class="edge"> -<title>Phi_arg8->Loop6</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M422.16,-298C424.62,-298 427.08,-298 429.55,-298"/> -<polygon fill="black" stroke="black" points="429.67,-301.5 439.67,-298 429.67,-294.5 429.67,-301.5"/> -<text text-anchor="middle" x="425.16" y="-291.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_9 --> -<g id="node4" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="303" cy="-298" rx="27" ry="18"/> -<text text-anchor="middle" x="303" y="-294.3" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT10 --> -<g id="node5" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="374" cy="-226" rx="27" ry="18"/> -<text text-anchor="middle" x="374" y="-222.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg8 --> -<g id="edge4" class="edge"> -<title>LT10->Phi_arg8</title> -<path fill="none" stroke="black" d="M376.66,-243.95C377.87,-251.65 379.34,-260.97 380.7,-269.64"/> -<polygon fill="black" stroke="black" points="377.28,-270.39 382.29,-279.72 384.19,-269.3 377.28,-270.39"/> -<text text-anchor="middle" x="373.66" y="-246.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT10->Con_9 --> -<g id="edge5" class="edge"> -<title>LT10->Con_9</title> -<path fill="none" stroke="black" d="M359.29,-241.5C349.39,-251.27 336.16,-264.31 325.01,-275.3"/> -<polygon fill="black" stroke="black" points="322.36,-273 317.69,-282.51 327.27,-277.99 322.36,-273"/> -<text text-anchor="middle" x="356.29" y="-244.1" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11 --> -<g id="node6" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="327,-143 327,-168 421,-168 421,-143 327,-143"/> -<polygon fill="none" stroke="black" points="327,-143 327,-168 421,-168 421,-143 327,-143"/> -<text text-anchor="start" x="368.5" y="-151.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="327,-112 327,-143 421,-143 421,-112 327,-112"/> -<polygon fill="yellow" stroke="transparent" points="332,-117 332,-138 372,-138 372,-117 332,-117"/> -<polygon fill="none" stroke="black" points="332,-117 332,-138 372,-138 372,-117 332,-117"/> -<text text-anchor="start" x="335" y="-123.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="372,-117 372,-138 416,-138 416,-117 372,-117"/> -<polygon fill="none" stroke="black" points="372,-117 372,-138 416,-138 416,-117 372,-117"/> -<text text-anchor="start" x="375" y="-123.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If11->Loop6 --> -<g id="edge6" class="edge"> -<title>If11->Loop6</title> -<path fill="none" stroke="red" d="M396.87,-172.17C401.36,-178.63 405.94,-185.46 410,-192 426.23,-218.13 442.79,-249.22 453.84,-270.75"/> -<polygon fill="red" stroke="red" points="450.85,-272.6 458.51,-279.92 457.09,-269.42 450.85,-272.6"/> -<text text-anchor="middle" x="393.87" y="-174.77" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT10 --> -<g id="edge7" class="edge"> -<title>If11->LT10</title> -<path fill="none" stroke="black" d="M374,-172.28C374,-180.58 374,-189.48 374,-197.56"/> -<polygon fill="black" stroke="black" points="370.5,-197.6 374,-207.6 377.5,-197.6 370.5,-197.6"/> -<text text-anchor="middle" x="371" y="-174.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node7" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="231" cy="-298" rx="27" ry="18"/> -<text text-anchor="middle" x="231" y="-294.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add16 --> -<g id="node8" class="node"> -<title>Add16</title> -<ellipse fill="none" stroke="black" cx="241" cy="-226" rx="27" ry="18"/> -<text text-anchor="middle" x="241" y="-222.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add16->Phi_arg8 --> -<g id="edge8" class="edge"> -<title>Add16->Phi_arg8</title> -<path fill="none" stroke="black" d="M262.25,-237.33C285.48,-248.62 323.06,-266.89 350.53,-280.24"/> -<polygon fill="black" stroke="black" points="349.26,-283.52 359.78,-284.74 352.32,-277.22 349.26,-283.52"/> -<text text-anchor="middle" x="265.25" y="-239.93" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16->Con_15 --> -<g id="edge9" class="edge"> -<title>Add16->Con_15</title> -<path fill="none" stroke="black" d="M238.58,-243.95C237.48,-251.65 236.15,-260.97 234.91,-269.64"/> -<polygon fill="black" stroke="black" points="231.42,-269.33 233.47,-279.72 238.35,-270.32 231.42,-269.33"/> -<text text-anchor="middle" x="235.58" y="-246.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Scope7_1 --> -<g id="node9" class="node"> -<title>Scope7_1</title> -<polygon fill="cyan" stroke="transparent" points="35,-39 35,-60 51,-60 51,-39 35,-39"/> -<polygon fill="none" stroke="black" points="35,-39 35,-60 51,-60 51,-39 35,-39"/> -<text text-anchor="start" x="38" y="-45.8" font-family="Times,serif" font-size="14.00">2</text> -</g> -<!-- Scope7_2 --> -<g id="node10" class="node"> -<title>Scope7_2</title> -<polygon fill="cyan" stroke="transparent" points="107,-39 107,-60 123,-60 123,-39 107,-39"/> -<polygon fill="none" stroke="black" points="107,-39 107,-60 123,-60 123,-39 107,-39"/> -<text text-anchor="start" x="110" y="-45.8" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Scope7_3 --> -<g id="node11" class="node"> -<title>Scope7_3</title> -<polygon fill="cyan" stroke="transparent" points="169,-39 169,-60 185,-60 185,-39 169,-39"/> -<polygon fill="none" stroke="black" points="169,-39 169,-60 185,-60 185,-39 169,-39"/> -<text text-anchor="start" x="172" y="-45.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="185,-39 185,-60 225,-60 225,-39 185,-39"/> -<text text-anchor="start" x="188" y="-45.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="225,-39 225,-60 256,-60 256,-39 225,-39"/> -<text text-anchor="start" x="228" y="-45.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope7_3->If11 --> -<g id="edge10" class="edge"> -<title>Scope7_3:Scope7_3_$ctrl->If11:p0</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M205,-61C205,-74.83 289.37,-114.99 321.05,-124.81"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="320.48,-128.27 331,-127 321.98,-121.43 320.48,-128.27"/> -</g> -<!-- Scope7_3->Add16 --> -<g id="edge11" class="edge"> -<title>Scope7_3:Scope7_3_arg->Add16</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M241,-61C241,-109.09 241,-165.12 241,-197.67"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="237.5,-197.76 241,-207.76 244.5,-197.76 237.5,-197.76"/> -</g> -<!-- Scope1_1 --> -<g id="node12" class="node"> -<title>Scope1_1</title> -<polygon fill="cyan" stroke="transparent" points="537,-215 537,-236 553,-236 553,-215 537,-215"/> -<polygon fill="none" stroke="black" points="537,-215 537,-236 553,-236 553,-215 537,-215"/> -<text text-anchor="start" x="540" y="-221.8" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Scope1_2 --> -<g id="node13" class="node"> -<title>Scope1_2</title> -<polygon fill="cyan" stroke="transparent" points="599,-215 599,-236 615,-236 615,-215 599,-215"/> -<polygon fill="none" stroke="black" points="599,-215 599,-236 615,-236 615,-215 599,-215"/> -<text text-anchor="start" x="602" y="-221.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="615,-215 615,-236 655,-236 655,-215 615,-215"/> -<text text-anchor="start" x="618" y="-221.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="655,-215 655,-236 686,-236 686,-215 655,-215"/> -<text text-anchor="start" x="658" y="-221.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope1_2->Loop6 --> -<g id="edge12" class="edge"> -<title>Scope1_2:Scope1_2_$ctrl->Loop6</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M635,-237C635,-264.54 553.92,-282.77 504.41,-291.34"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="503.65,-287.92 494.37,-293.02 504.81,-294.82 503.65,-287.92"/> -</g> -<!-- Scope1_2->Phi_arg8 --> -<g id="edge13" class="edge"> -<title>Scope1_2:Scope1_2_arg->Phi_arg8</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M671,-237C671,-275.71 624.96,-252.41 587,-260 518.46,-273.71 498.88,-263.33 431,-280 428.04,-280.73 425,-281.58 421.97,-282.52"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="420.79,-279.23 412.41,-285.72 423.01,-285.86 420.79,-279.23"/> -</g> -<!-- Scope14_1 --> -<g id="node14" class="node"> -<title>Scope14_1</title> -<polygon fill="cyan" stroke="transparent" points="323,-39 323,-60 339,-60 339,-39 323,-39"/> -<polygon fill="none" stroke="black" points="323,-39 323,-60 339,-60 339,-39 323,-39"/> -<text text-anchor="start" x="326" y="-45.8" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Scope14_2 --> -<g id="node15" class="node"> -<title>Scope14_2</title> -<polygon fill="cyan" stroke="transparent" points="385,-39 385,-60 401,-60 401,-39 385,-39"/> -<polygon fill="none" stroke="black" points="385,-39 385,-60 401,-60 401,-39 385,-39"/> -<text text-anchor="start" x="388" y="-45.8" font-family="Times,serif" font-size="14.00">0</text> -<polygon fill="none" stroke="black" points="401,-39 401,-60 441,-60 441,-39 401,-39"/> -<text text-anchor="start" x="404" y="-45.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="441,-39 441,-60 472,-60 472,-39 441,-39"/> -<text text-anchor="start" x="444" y="-45.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Scope14_2->Phi_arg8 --> -<g id="edge15" class="edge"> -<title>Scope14_2:Scope14_2_arg->Phi_arg8</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M457,-61C457,-151.88 449.62,-178.21 410,-260 408.01,-264.11 405.61,-268.3 403.09,-272.3"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="400.15,-270.4 397.51,-280.67 405.97,-274.28 400.15,-270.4"/> -</g> -<!-- Scope14_2->If11 --> -<g id="edge14" class="edge"> -<title>Scope14_2:Scope14_2_$ctrl->If11:p1</title> -<path fill="none" stroke="cornflowerblue" stroke-dasharray="5,2" d="M421,-61C421,-84.4 401.06,-88.09 395.45,-105.95"/> -<polygon fill="cornflowerblue" stroke="cornflowerblue" points="391.97,-105.6 394,-116 398.89,-106.6 391.97,-105.6"/> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="848" height="708" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 848 708" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(32,171)"><rect class="region-box" rx="8" width="296" height="102" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M84,527 C84,551 735.5,524 735.5,548" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #18 · ASSOC · 3: $ctrl</title></path><path class="edge ASSOC" id="e1i1" d="M256,379 C256,403 795.5,524 795.5,548" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #16 · ASSOC · 3: arg</title></path><path class="edge ASSOC" id="e5i0" d="M104,258 C104,282 735.5,255 735.5,279" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[0] → #6 · ASSOC · 2: $ctrl</title></path><path class="edge ASSOC" id="e5i1" d="M256,258 C256,282 795.5,255 795.5,279" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[1] → #8 · ASSOC · 2: arg</title></path><path class="edge CTRL" id="e6i1" d="M124,118 L124,205" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[1] → #14 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M244,118 L244,128 L256,128 L256,205" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #17 · DATA</title></path><path class="edge DATA" id="e10i1" d="M256,261 L256,298 L408,298 L408,326" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #8 · DATA</title></path><path class="edge DATA" id="e10i2" d="M572,278 L572,288 L438,288 L438,326" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M104,261 L104,430" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #6 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M408,382 L408,392 L184,392 L184,430" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #10 · DATA</title></path><path class="edge ASSOC" id="e12i0" d="M204,527 C204,551 735.5,604 735.5,628" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#12[0] → #19 · ASSOC · 2: $ctrl</title></path><path class="edge ASSOC" id="e12i1" d="M256,258 C256,282 795.5,604 795.5,628" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#12[1] → #8 · ASSOC · 2: arg</title></path><path class="edge DATA" id="e16i1" d="M256,261 L256,326" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #8 · DATA</title></path><path class="edge DATA" id="e16i2" d="M420,278 L420,288 L286,288 L286,326" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(704,548)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 Scope +Type not computed + +[0] → #18 ASSOC 3: $ctrl +[1] → #16 ASSOC 3: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">3: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">3: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n2" data-id="2" transform="translate(64,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(704,279)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #5</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 Scope +Type not computed + +[0] → #6 ASSOC 2: $ctrl +[1] → #8 ASSOC 2: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">2: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">2: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n6" data-id="6" transform="translate(44,211)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Loop +Type not computed + +[0] → — DATA +[1] → #14 CTRL</title><circle class="port" cx="40" cy="-3" r="3" fill="white"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n8" data-id="8" transform="translate(196,211)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 φ_arg +Type not computed + +[0] → #6 ASSOC +[1] → #17 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #6</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text></g><g class="node" id="n9" data-id="9" transform="translate(512,228)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 10 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(348,332)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(24,436)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #6 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n12" data-id="12" transform="translate(704,628)" style="opacity: 1;"><path class="box" d="M4,0H116Q120,0 120,4V52Q120,56 116,56H4Q0,56 0,52V4Q0,0 4,0Z" fill="#e5e0ff"/><text class="label" text-anchor="middle" x="60" y="48"><tspan>Scope</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 Scope +Type not computed + +[0] → #19 ASSOC 2: $ctrl +[1] → #8 ASSOC 2: arg</title><line class="row" x1="0" x2="120" y1="30" y2="30"/><line class="row" x1="63" x2="63" y1="0" y2="30"/><text class="bind" x="31.5" y="20" text-anchor="middle">2: $ctrl</text><text class="bind" x="91.5" y="20" text-anchor="middle">2: arg</text><circle class="port" cx="31.5" cy="0" r="3" fill="#536477"/><circle class="port" cx="91.5" cy="0" r="3" fill="#536477"/><text class="slot" x="31.5" y="-7" text-anchor="middle">0</text><text class="slot" x="91.5" y="-7" text-anchor="middle">1</text></g><g class="node" id="n14" data-id="14" transform="translate(64,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #14/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n15" data-id="15" transform="translate(360,228)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 1 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(196,332)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(184,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #17/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n18" data-id="18" transform="translate(24,480)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #18/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n19" data-id="19" transform="translate(144,480)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #19/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(32,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><title>Loop · 2 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #6"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter07/docs/07-graph2.json b/chapter07/docs/07-graph2.json new file mode 100644 index 00000000..cc0e6d6c --- /dev/null +++ b/chapter07/docs/07-graph2.json @@ -0,0 +1,26 @@ +{ + "ver": 1, + "comp": "chapter07/docs/07-graph2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 6, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 8, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 6, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 6, "par": 0, "nodes": [5, 6, 7, 8, 10, 11, 16]} + ] +} diff --git a/chapter07/docs/07-graph2.svg b/chapter07/docs/07-graph2.svg index 1fec9556..72153555 100644 --- a/chapter07/docs/07-graph2.svg +++ b/chapter07/docs/07-graph2.svg @@ -1,184 +1,119 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter07 Pages: 1 --> -<svg width="330pt" height="492pt" - viewBox="0.00 0.00 330.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)"> -<title>chapter07</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-488 326,-488 326,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-476 314,-476 314,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="141,-439 141,-464 222,-464 222,-439 141,-439"/> -<polygon fill="none" stroke="black" points="141,-439 141,-464 222,-464 222,-439 141,-439"/> -<text text-anchor="start" x="163" y="-447.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="141,-408 141,-439 222,-439 222,-408 141,-408"/> -<polygon fill="yellow" stroke="transparent" points="146,-413 146,-434 186,-434 186,-413 146,-413"/> -<polygon fill="none" stroke="black" points="146,-413 146,-434 186,-434 186,-413 146,-413"/> -<text text-anchor="start" x="149" y="-419.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="186,-413 186,-434 217,-434 217,-413 186,-413"/> -<text text-anchor="start" x="189" y="-419.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="153,-52 99,-52 99,-16 153,-16 153,-52"/> -<text text-anchor="middle" x="126" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return17 --> -<g id="node10" class="node"> -<title>Return17</title> -<polygon fill="yellow" stroke="black" points="159,-124 93,-124 93,-88 159,-88 159,-124"/> -<text text-anchor="middle" x="126" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return17 --> -<g id="edge1" class="edge"> -<title>Stop3->Return17</title> -<path fill="none" stroke="red" d="M126,-52.3C126,-60.02 126,-69.29 126,-77.89"/> -<polygon fill="red" stroke="red" points="122.5,-77.9 126,-87.9 129.5,-77.9 122.5,-77.9"/> -<text text-anchor="middle" x="123" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Loop6 --> -<g id="node3" class="node"> -<title>Loop6</title> -<polygon fill="yellow" stroke="black" points="306,-368 252,-368 252,-332 306,-332 306,-368"/> -<text text-anchor="middle" x="279" y="-346.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop6->Start2 --> -<g id="edge2" class="edge"> -<title>Loop6->Start2:p0</title> -<path fill="none" stroke="red" d="M251.93,-364.13C226.34,-376.71 189.56,-395.24 173.73,-405.41"/> -<polygon fill="red" stroke="red" points="171.34,-402.85 166,-412 175.88,-408.18 171.34,-402.85"/> -<text text-anchor="middle" x="248.93" y="-357.73" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If11 --> -<g id="node7" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="32,-195 32,-220 126,-220 126,-195 32,-195"/> -<polygon fill="none" stroke="black" points="32,-195 32,-220 126,-220 126,-195 32,-195"/> -<text text-anchor="start" x="73.5" y="-203.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="32,-164 32,-195 126,-195 126,-164 32,-164"/> -<polygon fill="yellow" stroke="transparent" points="37,-169 37,-190 77,-190 77,-169 37,-169"/> -<polygon fill="none" stroke="black" points="37,-169 37,-190 77,-190 77,-169 37,-169"/> -<text text-anchor="start" x="40" y="-175.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="77,-169 77,-190 121,-190 121,-169 77,-169"/> -<polygon fill="none" stroke="black" points="77,-169 77,-190 121,-190 121,-169 77,-169"/> -<text text-anchor="start" x="80" y="-175.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- Loop6->If11 --> -<g id="edge3" class="edge"> -<title>Loop6->If11:p0</title> -<path fill="none" stroke="red" d="M251.78,-335.24C248.86,-334.04 245.9,-332.93 243,-332 156.98,-304.48 103.76,-362.82 43,-296 18.41,-268.96 14.64,-203.69 27.49,-184.44"/> -<polygon fill="red" stroke="red" points="29.46,-187.33 36,-179 25.69,-181.43 29.46,-187.33"/> -<text text-anchor="middle" x="248.78" y="-328.84" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg8 --> -<g id="node4" class="node"> -<title>Phi_arg8</title> -<ellipse fill="lightyellow" stroke="black" cx="125" cy="-350" rx="37.09" ry="18"/> -<text text-anchor="middle" x="125" y="-346.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg8->Start2 --> -<g id="edge5" class="edge"> -<title>Phi_arg8->Start2:p1</title> -<path fill="none" stroke="black" d="M154.55,-360.93C173.21,-369 194.84,-382.27 200.56,-401.87"/> -<polygon fill="black" stroke="black" points="197.12,-402.59 202,-412 204.05,-401.61 197.12,-402.59"/> -<text text-anchor="middle" x="151.55" y="-363.53" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg8->Loop6 --> -<g id="edge4" class="edge"> -<title>Phi_arg8->Loop6</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M143.47,-334.01C153.54,-326.34 166.66,-317.98 180,-314 203,-307.14 211.35,-306.06 234,-314 241.14,-316.5 247.99,-320.67 254.09,-325.3"/> -<polygon fill="black" stroke="black" points="251.99,-328.1 261.92,-331.78 256.45,-322.71 251.99,-328.1"/> -<text text-anchor="middle" x="140.47" y="-327.61" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add16 --> -<g id="node9" class="node"> -<title>Add16</title> -<ellipse fill="none" stroke="black" cx="203" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="203" y="-274.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Con_9 --> -<g id="node5" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="43" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-346.3" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT10 --> -<g id="node6" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="79" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="79" y="-274.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg8 --> -<g id="edge7" class="edge"> -<title>LT10->Phi_arg8</title> -<path fill="none" stroke="black" d="M89.44,-294.88C95.12,-303.53 102.28,-314.42 108.68,-324.17"/> -<polygon fill="black" stroke="black" points="105.87,-326.26 114.28,-332.69 111.72,-322.41 105.87,-326.26"/> -<text text-anchor="middle" x="86.44" y="-297.48" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT10->Con_9 --> -<g id="edge8" class="edge"> -<title>LT10->Con_9</title> -<path fill="none" stroke="black" d="M70.65,-295.24C66.29,-303.72 60.85,-314.29 55.96,-323.8"/> -<polygon fill="black" stroke="black" points="52.77,-322.36 51.3,-332.85 58.99,-325.56 52.77,-322.36"/> -<text text-anchor="middle" x="67.65" y="-297.84" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11->Loop6 --> -<g id="edge9" class="edge"> -<title>If11->Loop6</title> -<path fill="none" stroke="red" d="M134.07,-205.07C167.93,-214.93 210.21,-231.94 239,-260 256.28,-276.84 266.71,-302.48 272.57,-321.93"/> -<polygon fill="red" stroke="red" points="269.24,-323.03 275.3,-331.72 275.98,-321.15 269.24,-323.03"/> -<text text-anchor="middle" x="137.07" y="-198.67" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT10 --> -<g id="edge10" class="edge"> -<title>If11->LT10</title> -<path fill="none" stroke="black" d="M79,-224.28C79,-232.58 79,-241.48 79,-249.56"/> -<polygon fill="black" stroke="black" points="75.5,-249.6 79,-259.6 82.5,-249.6 75.5,-249.6"/> -<text text-anchor="middle" x="76" y="-226.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node8" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="207" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-346.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add16->Phi_arg8 --> -<g id="edge11" class="edge"> -<title>Add16->Phi_arg8</title> -<path fill="none" stroke="black" d="M180.01,-299.63C170.41,-308.25 159.23,-318.28 149.47,-327.04"/> -<polygon fill="black" stroke="black" points="182.48,-302.11 187.59,-292.83 177.81,-296.9 182.48,-302.11"/> -<polygon fill="black" stroke="black" points="147.11,-324.46 142,-333.74 151.78,-329.67 147.11,-324.46"/> -<text text-anchor="middle" x="184.59" y="-295.43" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16->Con_15 --> -<g id="edge12" class="edge"> -<title>Add16->Con_15</title> -<path fill="none" stroke="black" d="M203.99,-296.3C204.43,-304.02 204.96,-313.29 205.45,-321.89"/> -<polygon fill="black" stroke="black" points="201.96,-322.11 206.02,-331.9 208.95,-321.71 201.96,-322.11"/> -<text text-anchor="middle" x="200.99" y="-298.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return17->Phi_arg8 --> -<g id="edge14" class="edge"> -<title>Return17->Phi_arg8</title> -<path fill="none" stroke="black" d="M133.07,-124.33C136.84,-134.53 141.09,-147.78 143,-160 151.97,-217.35 140.08,-285.24 131.79,-322.03"/> -<polygon fill="black" stroke="black" points="128.33,-321.44 129.46,-331.97 135.14,-323.03 128.33,-321.44"/> -<text text-anchor="middle" x="130.07" y="-126.93" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return17->If11 --> -<g id="edge13" class="edge"> -<title>Return17->If11:p1</title> -<path fill="none" stroke="red" d="M113.92,-124C108.25,-133.3 102.24,-145.44 99.95,-157.94"/> -<polygon fill="red" stroke="red" points="96.46,-157.71 99,-168 103.43,-158.38 96.46,-157.71"/> -<text text-anchor="middle" x="110.92" y="-126.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="841" height="788" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841 788" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="637" height="410" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M246,687 C246,711 420.5,714 420.5,738" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #17 · CTRL</title></path><path class="edge CTRL" id="e6i1" d="M126,118 L126,241" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e6i2" d="M106,546 L106,556 L649,556 L649,224 L156,224 L156,244" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[2] → #5 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M246,118 L246,128 L258,128 L258,241" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M525,398 L525,408 L639,408 L639,232 L298,232 L298,244" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #16 · DATA</title></path><path class="edge DATA" id="e10i1" d="M278,297 L278,317 L373,317 L373,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #8 · DATA</title></path><path class="edge DATA" id="e10i2" d="M605,118 L605,307 L403,307 L403,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M126,297 L126,449" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #6 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M373,401 L373,411 L206,411 L206,449" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #10 · DATA</title></path><path class="edge DATA" id="e16i1" d="M278,297 L278,317 L525,317 L525,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #8 · DATA</title></path><path class="edge DATA" id="e16i2" d="M757,118 L757,128 L616,128 L616,317 L555,317 L555,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path><path class="edge CTRL" id="e17i0" d="M226,549 L226,634" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[0] → #7 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M278,297 L278,317 L302,317 L302,596 L266,596 L266,634" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #8 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(66,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(66,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(384.5,738)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #17 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(186,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(46,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(66,247)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #5 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n7" data-id="7" transform="translate(166,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #7/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(218,247)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 φ_arg +Type not computed + +[0] → #6 ASSOC +[1] → #4 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #6</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(545,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 10 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(313,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(46,455)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #6 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n15" data-id="15" transform="translate(697,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 1 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(465,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(186,640)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 Return +Type not computed + +[0] → #7 CTRL +[1] → #8 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><title>Loop · 7 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #6"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter07/docs/07-graph3.json b/chapter07/docs/07-graph3.json new file mode 100644 index 00000000..26dbc457 --- /dev/null +++ b/chapter07/docs/07-graph3.json @@ -0,0 +1,40 @@ +{ + "ver": 1, + "comp": "chapter07/docs/07-graph3.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 35, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 14, "role": "CTRL", "label": null}], "proj": {"par": 14, "idx": 0}}, + {"id": 6, "label": "0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 15, "role": "CTRL", "label": null}], "proj": null}, + {"id": 9, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 14, "role": "CTRL", "label": null}], "proj": {"par": 14, "idx": 1}}, + {"id": 10, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 28, "role": "CTRL", "label": null}], "proj": {"par": 28, "idx": 0}}, + {"id": 11, "label": "φ_sum", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 8, "role": "ASSOC", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "φ_i", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 8, "role": "ASSOC", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 19, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 14, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 28, "role": "CTRL", "label": null}], "proj": {"par": 28, "idx": 1}}, + {"id": 18, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 19, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}, {"idx": 2, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 21, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 24, "label": "φ_sum", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 21, "role": "ASSOC", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}, {"idx": 2, "def": 32, "role": "DATA", "label": null}], "proj": null}, + {"id": 26, "label": "φ_j", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 21, "role": "ASSOC", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}, {"idx": 2, "def": 34, "role": "DATA", "label": null}], "proj": null}, + {"id": 27, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 26, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 28, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}, {"idx": 1, "def": 27, "role": "DATA", "label": null}], "proj": null}, + {"id": 32, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 26, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null}, + {"id": 33, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 34, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 26, "role": "DATA", "label": null}, {"idx": 2, "def": 33, "role": "DATA", "label": null}], "proj": null}, + {"id": 35, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [5, 8, 9, 11, 12, 13, 14, 19]}, + {"id": 21, "par": 8, "nodes": [10, 15, 21, 24, 26, 27, 28, 32, 34]} + ] +} diff --git a/chapter07/docs/07-graph3.svg b/chapter07/docs/07-graph3.svg index a9a0e8d0..181b72a9 100644 --- a/chapter07/docs/07-graph3.svg +++ b/chapter07/docs/07-graph3.svg @@ -1,373 +1,175 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter07 Pages: 1 --> -<svg width="462pt" height="592pt" - viewBox="0.00 0.00 462.00 592.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 588)"> -<title>chapter07</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-588 458,-588 458,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-576 446,-576 446,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="148,-539 148,-564 229,-564 229,-539 148,-539"/> -<polygon fill="none" stroke="black" points="148,-539 148,-564 229,-564 229,-539 148,-539"/> -<text text-anchor="start" x="170" y="-547.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="148,-508 148,-539 229,-539 229,-508 148,-508"/> -<polygon fill="yellow" stroke="transparent" points="153,-513 153,-534 193,-534 193,-513 153,-513"/> -<polygon fill="none" stroke="black" points="153,-513 153,-534 193,-534 193,-513 153,-513"/> -<text text-anchor="start" x="156" y="-519.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="193,-513 193,-534 224,-534 224,-513 193,-513"/> -<text text-anchor="start" x="196" y="-519.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="432,-152 378,-152 378,-116 432,-116 432,-152"/> -<text text-anchor="middle" x="405" y="-130.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return35 --> -<g id="node21" class="node"> -<title>Return35</title> -<polygon fill="yellow" stroke="black" points="438,-224 372,-224 372,-188 438,-188 438,-224"/> -<text text-anchor="middle" x="405" y="-202.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return35 --> -<g id="edge1" class="edge"> -<title>Stop3->Return35</title> -<path fill="none" stroke="red" d="M405,-152.3C405,-160.02 405,-169.29 405,-177.89"/> -<polygon fill="red" stroke="red" points="401.5,-177.9 405,-187.9 408.5,-177.9 401.5,-177.9"/> -<text text-anchor="middle" x="402" y="-154.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="94" cy="-536" rx="27" ry="18"/> -<text text-anchor="middle" x="94" y="-532.3" font-family="Times,serif" font-size="14.00">0</text> -</g> -<!-- Con_7 --> -<g id="node4" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="282" cy="-536" rx="27" ry="18"/> -<text text-anchor="middle" x="282" y="-532.3" font-family="Times,serif" font-size="14.00">0</text> -</g> -<!-- Loop8 --> -<g id="node5" class="node"> -<title>Loop8</title> -<polygon fill="yellow" stroke="black" points="426,-468 372,-468 372,-432 426,-432 426,-468"/> -<text text-anchor="middle" x="399" y="-446.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop8->Start2 --> -<g id="edge2" class="edge"> -<title>Loop8->Start2:p0</title> -<path fill="none" stroke="red" d="M371.74,-464.61C368.82,-465.84 365.87,-467 363,-468 325.58,-481 197.82,-470.79 176.14,-502.03"/> -<polygon fill="red" stroke="red" points="172.67,-501.41 173,-512 179.34,-503.51 172.67,-501.41"/> -<text text-anchor="middle" x="368.74" y="-458.21" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If28 --> -<g id="node17" class="node"> -<title>If28</title> -<polygon fill="yellow" stroke="transparent" points="142,-51 142,-76 236,-76 236,-51 142,-51"/> -<polygon fill="none" stroke="black" points="142,-51 142,-76 236,-76 236,-51 142,-51"/> -<text text-anchor="start" x="183.5" y="-59.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="142,-20 142,-51 236,-51 236,-20 142,-20"/> -<polygon fill="yellow" stroke="transparent" points="147,-25 147,-46 187,-46 187,-25 147,-25"/> -<polygon fill="none" stroke="black" points="147,-25 147,-46 187,-46 187,-25 147,-25"/> -<text text-anchor="start" x="150" y="-31.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="187,-25 187,-46 231,-46 231,-25 187,-25"/> -<polygon fill="none" stroke="black" points="187,-25 187,-46 231,-46 231,-25 187,-25"/> -<text text-anchor="start" x="190" y="-31.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- Loop8->If28 --> -<g id="edge3" class="edge"> -<title>Loop8->If28:p1</title> -<path fill="none" stroke="red" d="M371.72,-435.44C368.81,-434.2 365.86,-433.02 363,-432 300.87,-409.81 259.6,-448 219,-396 176.78,-341.93 243.11,-308.12 292,-260 311.77,-240.54 330.24,-248.63 343,-224 350.36,-209.79 353.65,-199.94 343,-188 248.88,-82.54 121.12,-257.46 27,-152 16.35,-140.06 16.65,-128.2 27,-116 90.22,-41.43 180.78,-154.57 244,-80 259.81,-61.35 261.04,-42.53 244,-25 236.29,-17.07 221.85,-12.04 214.15,-15.39"/> -<polygon fill="red" stroke="red" points="211.13,-13.62 209,-24 217.14,-17.22 211.13,-13.62"/> -<text text-anchor="middle" x="368.72" y="-429.04" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_sum11 --> -<g id="node6" class="node"> -<title>Phi_sum11</title> -<ellipse fill="lightyellow" stroke="black" cx="149" cy="-450" rx="40.89" ry="18"/> -<text text-anchor="middle" x="149" y="-446.3" font-family="Times,serif" font-size="14.00">φ_sum</text> -</g> -<!-- Phi_sum11->Con_6 --> -<g id="edge5" class="edge"> -<title>Phi_sum11->Con_6</title> -<path fill="none" stroke="black" d="M138.13,-467.6C130.07,-479.91 118.95,-496.89 109.89,-510.73"/> -<polygon fill="black" stroke="black" points="106.84,-509.01 104.29,-519.29 112.69,-512.84 106.84,-509.01"/> -<text text-anchor="middle" x="135.13" y="-470.2" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_sum11->Loop8 --> -<g id="edge4" class="edge"> -<title>Phi_sum11->Loop8</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M173.66,-435.44C188.78,-427.38 208.85,-418.16 228,-414 282.73,-402.12 301.16,-395.46 354,-414 361.14,-416.5 367.99,-420.67 374.09,-425.3"/> -<polygon fill="black" stroke="black" points="371.99,-428.1 381.92,-431.78 376.45,-422.71 371.99,-428.1"/> -<text text-anchor="middle" x="170.66" y="-429.04" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_sum24 --> -<g id="node14" class="node"> -<title>Phi_sum24</title> -<ellipse fill="lightyellow" stroke="black" cx="149" cy="-206" rx="40.89" ry="18"/> -<text text-anchor="middle" x="149" y="-202.3" font-family="Times,serif" font-size="14.00">φ_sum</text> -</g> -<!-- Phi_i12 --> -<g id="node7" class="node"> -<title>Phi_i12</title> -<ellipse fill="lightyellow" stroke="black" cx="255" cy="-450" rx="27" ry="18"/> -<text text-anchor="middle" x="255" y="-446.3" font-family="Times,serif" font-size="14.00">φ_i</text> -</g> -<!-- Phi_i12->Con_7 --> -<g id="edge8" class="edge"> -<title>Phi_i12->Con_7</title> -<path fill="none" stroke="black" d="M260.46,-468C264.22,-479.69 269.28,-495.44 273.56,-508.73"/> -<polygon fill="black" stroke="black" points="270.24,-509.86 276.64,-518.31 276.91,-507.72 270.24,-509.86"/> -<text text-anchor="middle" x="257.46" y="-470.6" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_i12->Loop8 --> -<g id="edge7" class="edge"> -<title>Phi_i12->Loop8</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M269.22,-434.43C277.37,-426.68 288.29,-418.11 300,-414 322.65,-406.06 331.35,-406.06 354,-414 361.14,-416.5 367.99,-420.67 374.09,-425.3"/> -<polygon fill="black" stroke="black" points="371.99,-428.1 381.92,-431.78 376.45,-422.71 371.99,-428.1"/> -<text text-anchor="middle" x="266.22" y="-428.03" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add19 --> -<g id="node11" class="node"> -<title>Add19</title> -<ellipse fill="none" stroke="black" cx="327" cy="-378" rx="27" ry="18"/> -<text text-anchor="middle" x="327" y="-374.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- LT13 --> -<g id="node8" class="node"> -<title>LT13</title> -<ellipse fill="none" stroke="black" cx="255" cy="-378" rx="27" ry="18"/> -<text text-anchor="middle" x="255" y="-374.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT13->Start2 --> -<g id="edge11" class="edge"> -<title>LT13->Start2:p1</title> -<path fill="none" stroke="black" d="M241.85,-394.14C233.87,-404.19 224.26,-418.05 219,-432 207.64,-462.12 208.62,-473.77 208.94,-501.81"/> -<polygon fill="black" stroke="black" points="205.44,-502.02 209,-512 212.44,-501.98 205.44,-502.02"/> -<text text-anchor="middle" x="238.85" y="-396.74" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- LT13->Phi_i12 --> -<g id="edge10" class="edge"> -<title>LT13->Phi_i12</title> -<path fill="none" stroke="black" d="M255,-396.3C255,-404.02 255,-413.29 255,-421.89"/> -<polygon fill="black" stroke="black" points="251.5,-421.9 255,-431.9 258.5,-421.9 251.5,-421.9"/> -<text text-anchor="middle" x="252" y="-398.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If14 --> -<g id="node9" class="node"> -<title>If14</title> -<polygon fill="yellow" stroke="transparent" points="309,-295 309,-320 403,-320 403,-295 309,-295"/> -<polygon fill="none" stroke="black" points="309,-295 309,-320 403,-320 403,-295 309,-295"/> -<text text-anchor="start" x="350.5" y="-303.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="309,-264 309,-295 403,-295 403,-264 309,-264"/> -<polygon fill="yellow" stroke="transparent" points="314,-269 314,-290 354,-290 354,-269 314,-269"/> -<polygon fill="none" stroke="black" points="314,-269 314,-290 354,-290 354,-269 314,-269"/> -<text text-anchor="start" x="317" y="-275.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="354,-269 354,-290 398,-290 398,-269 354,-269"/> -<polygon fill="none" stroke="black" points="354,-269 354,-290 398,-290 398,-269 354,-269"/> -<text text-anchor="start" x="357" y="-275.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If14->Loop8 --> -<g id="edge12" class="edge"> -<title>If14->Loop8</title> -<path fill="none" stroke="red" d="M364.6,-324.19C372.47,-352.77 384.02,-394.64 391.52,-421.86"/> -<polygon fill="red" stroke="red" points="388.24,-423.15 394.27,-431.86 394.99,-421.29 388.24,-423.15"/> -<text text-anchor="middle" x="361.6" y="-326.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If14->LT13 --> -<g id="edge13" class="edge"> -<title>If14->LT13</title> -<path fill="none" stroke="black" d="M318.68,-324.04C305.44,-335.05 290.9,-347.14 279.06,-356.99"/> -<polygon fill="black" stroke="black" points="276.79,-354.32 271.34,-363.41 281.27,-359.7 276.79,-354.32"/> -<text text-anchor="middle" x="315.68" y="-326.64" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_18 --> -<g id="node10" class="node"> -<title>Con_18</title> -<ellipse fill="none" stroke="black" cx="327" cy="-450" rx="27" ry="18"/> -<text text-anchor="middle" x="327" y="-446.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add19->Phi_i12 --> -<g id="edge14" class="edge"> -<title>Add19->Phi_i12</title> -<path fill="none" stroke="black" d="M304.96,-400.43C296.13,-409.01 285.99,-418.87 277.15,-427.46"/> -<polygon fill="black" stroke="black" points="307.7,-402.65 312.43,-393.17 302.82,-397.63 307.7,-402.65"/> -<polygon fill="black" stroke="black" points="274.53,-425.13 269.8,-434.62 279.41,-430.15 274.53,-425.13"/> -<text text-anchor="middle" x="309.43" y="-395.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add19->Con_18 --> -<g id="edge15" class="edge"> -<title>Add19->Con_18</title> -<path fill="none" stroke="black" d="M327,-396.3C327,-404.02 327,-413.29 327,-421.89"/> -<polygon fill="black" stroke="black" points="323.5,-421.9 327,-431.9 330.5,-421.9 323.5,-421.9"/> -<text text-anchor="middle" x="324" y="-398.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_20 --> -<g id="node12" class="node"> -<title>Con_20</title> -<ellipse fill="none" stroke="black" cx="63" cy="-292" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-288.3" font-family="Times,serif" font-size="14.00">0</text> -</g> -<!-- Loop21 --> -<g id="node13" class="node"> -<title>Loop21</title> -<polygon fill="yellow" stroke="black" points="334,-224 280,-224 280,-188 334,-188 334,-224"/> -<text text-anchor="middle" x="307" y="-202.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop21->If14 --> -<g id="edge16" class="edge"> -<title>Loop21->If14:p0</title> -<path fill="none" stroke="red" d="M319.08,-224C324.75,-233.3 330.76,-245.44 333.05,-257.94"/> -<polygon fill="red" stroke="red" points="329.57,-258.38 334,-268 336.54,-257.71 329.57,-258.38"/> -<text text-anchor="middle" x="316.08" y="-226.6" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Loop21->If28 --> -<g id="edge17" class="edge"> -<title>Loop21->If28:p0</title> -<path fill="none" stroke="red" d="M279.81,-191.15C276.88,-189.96 273.91,-188.88 271,-188 218.54,-172.13 62.82,-193.49 27,-152 -19.29,-98.38 63.73,-40.46 135.9,-35.36"/> -<polygon fill="red" stroke="red" points="136.13,-38.86 146,-35 135.88,-31.86 136.13,-38.86"/> -<text text-anchor="middle" x="276.81" y="-184.75" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_sum24->Phi_sum11 --> -<g id="edge19" class="edge"> -<title>Phi_sum24->Phi_sum11</title> -<path fill="none" stroke="black" d="M149,-234.1C149,-280.5 149,-374.66 149,-421.4"/> -<polygon fill="black" stroke="black" points="152.5,-234.02 149,-224.02 145.5,-234.02 152.5,-234.02"/> -<polygon fill="black" stroke="black" points="145.5,-421.68 149,-431.68 152.5,-421.68 145.5,-421.68"/> -<text text-anchor="middle" x="146" y="-226.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_sum24->Loop21 --> -<g id="edge18" class="edge"> -<title>Phi_sum24->Loop21</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M168.72,-190.18C179.62,-182.46 193.79,-173.99 208,-170 231.11,-163.51 239.35,-162.06 262,-170 269.14,-172.5 275.99,-176.67 282.09,-181.3"/> -<polygon fill="black" stroke="black" points="279.99,-184.1 289.92,-187.78 284.45,-178.71 279.99,-184.1"/> -<text text-anchor="middle" x="165.72" y="-183.78" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add32 --> -<g id="node18" class="node"> -<title>Add32</title> -<ellipse fill="none" stroke="black" cx="142" cy="-134" rx="27" ry="18"/> -<text text-anchor="middle" x="142" y="-130.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Phi_j26 --> -<g id="node15" class="node"> -<title>Phi_j26</title> -<ellipse fill="lightyellow" stroke="black" cx="63" cy="-206" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-202.3" font-family="Times,serif" font-size="14.00">φ_j</text> -</g> -<!-- Phi_j26->Con_20 --> -<g id="edge22" class="edge"> -<title>Phi_j26->Con_20</title> -<path fill="none" stroke="black" d="M63,-224.4C63,-235.74 63,-250.77 63,-263.68"/> -<polygon fill="black" stroke="black" points="59.5,-263.9 63,-273.9 66.5,-263.9 59.5,-263.9"/> -<text text-anchor="middle" x="60" y="-227" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_j26->Loop21 --> -<g id="edge21" class="edge"> -<title>Phi_j26->Loop21</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M77.22,-190.43C85.37,-182.68 96.29,-174.11 108,-170 172.59,-147.34 197.41,-147.34 262,-170 269.14,-172.5 275.99,-176.67 282.09,-181.3"/> -<polygon fill="black" stroke="black" points="279.99,-184.1 289.92,-187.78 284.45,-178.71 279.99,-184.1"/> -<text text-anchor="middle" x="74.22" y="-184.03" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add34 --> -<g id="node20" class="node"> -<title>Add34</title> -<ellipse fill="none" stroke="black" cx="225" cy="-134" rx="27" ry="18"/> -<text text-anchor="middle" x="225" y="-130.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- LT27 --> -<g id="node16" class="node"> -<title>LT27</title> -<ellipse fill="none" stroke="black" cx="63" cy="-134" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-130.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT27->Start2 --> -<g id="edge25" class="edge"> -<title>LT27->Start2:p1</title> -<path fill="none" stroke="black" d="M49.72,-150.09C41.69,-160.12 32.07,-173.98 27,-188 11.37,-231.26 17,-245.01 17,-291 17,-291 17,-291 17,-379 17,-432.79 54.71,-437.48 99,-468 139.14,-495.66 199.24,-464.69 207.94,-501.72"/> -<polygon fill="black" stroke="black" points="204.49,-502.41 209,-512 211.45,-501.69 204.49,-502.41"/> -<text text-anchor="middle" x="46.72" y="-152.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- LT27->Phi_j26 --> -<g id="edge24" class="edge"> -<title>LT27->Phi_j26</title> -<path fill="none" stroke="black" d="M63,-152.3C63,-160.02 63,-169.29 63,-177.89"/> -<polygon fill="black" stroke="black" points="59.5,-177.9 63,-187.9 66.5,-177.9 59.5,-177.9"/> -<text text-anchor="middle" x="60" y="-154.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If28->Loop21 --> -<g id="edge26" class="edge"> -<title>If28->Loop21</title> -<path fill="none" stroke="red" d="M227.35,-80.17C239.01,-90.79 251.3,-103.21 261,-116 275.71,-135.38 288.07,-160.15 296.27,-178.63"/> -<polygon fill="red" stroke="red" points="293.1,-180.12 300.27,-187.92 299.53,-177.35 293.1,-180.12"/> -<text text-anchor="middle" x="224.35" y="-82.77" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If28->LT27 --> -<g id="edge27" class="edge"> -<title>If28->LT27</title> -<path fill="none" stroke="black" d="M142.44,-80.04C124.74,-91.84 105.18,-104.88 89.9,-115.07"/> -<polygon fill="black" stroke="black" points="87.82,-112.24 81.44,-120.7 91.71,-118.07 87.82,-112.24"/> -<text text-anchor="middle" x="139.44" y="-82.64" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add32->Phi_sum24 --> -<g id="edge29" class="edge"> -<title>Add32->Phi_sum24</title> -<path fill="none" stroke="black" d="M144.73,-162.33C145.24,-167.45 145.78,-172.79 146.29,-177.9"/> -<polygon fill="black" stroke="black" points="148.21,-161.91 143.73,-152.3 141.24,-162.6 148.21,-161.91"/> -<polygon fill="black" stroke="black" points="142.81,-178.29 147.29,-187.9 149.78,-177.6 142.81,-178.29"/> -<text text-anchor="middle" x="140.73" y="-154.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add32->Phi_j26 --> -<g id="edge28" class="edge"> -<title>Add32->Phi_j26</title> -<path fill="none" stroke="black" d="M126.39,-148.83C114.92,-158.99 99.15,-172.97 86.21,-184.44"/> -<polygon fill="black" stroke="black" points="83.74,-181.95 78.58,-191.2 88.38,-187.19 83.74,-181.95"/> -<text text-anchor="middle" x="123.39" y="-151.43" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_33 --> -<g id="node19" class="node"> -<title>Con_33</title> -<ellipse fill="none" stroke="black" cx="235" cy="-206" rx="27" ry="18"/> -<text text-anchor="middle" x="235" y="-202.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add34->Phi_j26 --> -<g id="edge30" class="edge"> -<title>Add34->Phi_j26</title> -<path fill="none" stroke="black" d="M193.01,-148.01C167.45,-158.51 130.76,-173.83 99,-188 97.2,-188.8 95.36,-189.64 93.5,-190.49"/> -<polygon fill="black" stroke="black" points="194.64,-151.12 202.57,-144.09 191.99,-144.65 194.64,-151.12"/> -<polygon fill="black" stroke="black" points="91.85,-187.39 84.25,-194.78 94.79,-193.74 91.85,-187.39"/> -<text text-anchor="middle" x="199.57" y="-146.69" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add34->Con_33 --> -<g id="edge31" class="edge"> -<title>Add34->Con_33</title> -<path fill="none" stroke="black" d="M227.42,-151.95C228.52,-159.65 229.85,-168.97 231.09,-177.64"/> -<polygon fill="black" stroke="black" points="227.65,-178.32 232.53,-187.72 234.58,-177.33 227.65,-178.32"/> -<text text-anchor="middle" x="224.42" y="-154.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return35->Phi_sum11 --> -<g id="edge33" class="edge"> -<title>Return35->Phi_sum11</title> -<path fill="none" stroke="black" d="M371.93,-220.42C343.47,-232.34 305.01,-249.46 292,-260 233.39,-307.47 185.4,-383.86 162.87,-423.42"/> -<polygon fill="black" stroke="black" points="159.79,-421.75 157.95,-432.19 165.89,-425.18 159.79,-421.75"/> -<text text-anchor="middle" x="368.93" y="-214.02" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return35->If14 --> -<g id="edge32" class="edge"> -<title>Return35->If14:p1</title> -<path fill="none" stroke="red" d="M391.86,-224.13C385.8,-233.37 379.43,-245.41 377.01,-257.92"/> -<polygon fill="red" stroke="red" points="373.52,-257.7 376,-268 380.48,-258.4 373.52,-257.7"/> -<text text-anchor="middle" x="388.86" y="-226.73" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1334" height="1332" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1334 1332" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(72,171)"><rect class="region-box" rx="8" width="1092" height="954" fill="#f1f6fc"/></g><g class="region" transform="translate(116,640)"><rect class="region-box" rx="8" width="666" height="438" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M812,1231 C812,1255 667,1258 667,1282" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #35 · CTRL</title></path><path class="edge CTRL" id="e8i1" d="M692,118 L692,279" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e8i2" d="M328,1043 L328,1053 L1152,1053 L1152,254 L722,254 L722,282" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[2] → #15 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M388,118 L388,138 L672,138 L672,259 L824,259 L824,279" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #6 · DATA</title></path><path class="edge DATA" id="e11i2" d="M380,791 L380,801 L1142,801 L1142,262 L864,262 L864,282" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[2] → #24 · DATA</title></path><path class="edge DATA" id="e12i1" d="M540,118 L540,128 L682,128 L682,239 L976,239 L976,279" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #7 · DATA</title></path><path class="edge DATA" id="e12i2" d="M844,436 L844,446 L1132,446 L1132,270 L1016,270 L1016,282" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[2] → #19 · DATA</title></path><path class="edge DATA" id="e13i1" d="M996,335 L996,383" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[1] → #12 · DATA</title></path><path class="edge DATA" id="e13i2" d="M812,118 L812,128 L1076,128 L1076,345 L1026,345 L1026,383" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[2] → #4 · DATA</title></path><path class="edge CTRL" id="e14i0" d="M692,335 L692,487" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #8 · CTRL</title></path><path class="edge DATA" id="e14i1" d="M996,439 L996,469 L772,469 L772,487" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #13 · DATA</title></path><path class="edge DATA" id="e19i1" d="M996,335 L996,355 L844,355 L844,383" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #12 · DATA</title></path><path class="edge DATA" id="e19i2" d="M84,118 L84,365 L874,365 L874,383" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[2] → #18 · DATA</title></path><path class="edge CTRL" id="e21i1" d="M672,587 L672,597 L228,597 L228,738" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e21i2" d="M208,1043 L208,1053 L770,1053 L770,713 L258,713 L258,741" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[2] → #10 · CTRL</title></path><path class="edge DATA" id="e24i1" d="M844,335 L844,345 L773,345 L773,459 L218,459 L218,708 L360,708 L360,738" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[1] → #11 · DATA</title></path><path class="edge DATA" id="e24i2" d="M334,895 L334,905 L760,905 L760,721 L400,721 L400,741" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[2] → #32 · DATA</title></path><path class="edge DATA" id="e26i1" d="M1098,118 L1098,607 L717,607 L717,708 L512,708 L512,738" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#26[1] → #20 · DATA</title></path><path class="edge DATA" id="e26i2" d="M627,895 L627,905 L750,905 L750,729 L552,729 L552,741" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#26[2] → #34 · DATA</title></path><path class="edge DATA" id="e27i1" d="M532,794 L532,804 L475,804 L475,842" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#27[1] → #26 · DATA</title></path><path class="edge DATA" id="e27i2" d="M812,118 L812,128 L1087,128 L1087,597 L707,597 L707,814 L505,814 L505,842" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#27[2] → #4 · DATA</title></path><path class="edge CTRL" id="e28i0" d="M228,794 L228,946" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#28[0] → #21 · CTRL</title></path><path class="edge DATA" id="e28i1" d="M475,898 L475,918 L308,918 L308,946" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#28[1] → #27 · DATA</title></path><path class="edge DATA" id="e32i1" d="M532,794 L532,804 L334,804 L334,842" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#32[1] → #26 · DATA</title></path><path class="edge DATA" id="e32i2" d="M380,794 L380,814 L364,814 L364,842" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#32[2] → #24 · DATA</title></path><path class="edge DATA" id="e34i1" d="M532,794 L532,804 L627,804 L627,842" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#34[1] → #26 · DATA</title></path><path class="edge DATA" id="e34i2" d="M1250,118 L1250,128 L1109,128 L1109,617 L727,617 L727,824 L657,824 L657,842" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#34[2] → #33 · DATA</title></path><path class="edge CTRL" id="e35i0" d="M792,587 L792,1178" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#35[0] → #9 · CTRL</title></path><path class="edge DATA" id="e35i1" d="M844,335 L844,345 L773,345 L773,459 L868,459 L868,1140 L832,1140 L832,1178" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[1] → #11 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(632,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(632,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(631,1282)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #35 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(752,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(612,537)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #14 +Type not computed + +[0] → #14 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(328,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>0</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 0 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(480,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>0</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 0 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(632,285)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #15 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(732,537)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #9/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 False +Projection 1 of #14 +Type not computed + +[0] → #14 CTRL</title></g><g class="node" id="n10" data-id="10" transform="translate(148,996)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #10/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 True +Projection 0 of #28 +Type not computed + +[0] → #28 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(784,285)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_sum</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 φ_sum +Type not computed + +[0] → #8 ASSOC +[1] → #6 DATA +[2] → #24 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #8</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(936,285)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_i</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 φ_i +Type not computed + +[0] → #8 ASSOC +[1] → #7 DATA +[2] → #19 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #8</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n13" data-id="13" transform="translate(936,389)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 < +Type not computed + +[0] → — DATA +[1] → #12 DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n14" data-id="14" transform="translate(612,493)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#14 If +Type not computed + +[0] → #8 CTRL +[1] → #13 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n15" data-id="15" transform="translate(268,996)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #15/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 False +Projection 1 of #28 +Type not computed + +[0] → #28 CTRL</title></g><g class="node" id="n18" data-id="18" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 1 +Type not computed + +</title></g><g class="node" id="n19" data-id="19" transform="translate(784,389)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 + +Type not computed + +[0] → — DATA +[1] → #12 DATA +[2] → #18 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n20" data-id="20" transform="translate(1038,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>0</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 0 +Type not computed + +</title></g><g class="node" id="n21" data-id="21" transform="translate(168,744)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Loop +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #10 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n24" data-id="24" transform="translate(320,744)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_sum</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 φ_sum +Type not computed + +[0] → #21 ASSOC +[1] → #11 DATA +[2] → #32 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #21</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n26" data-id="26" transform="translate(472,744)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_j</tspan><tspan class="node-id">  #26</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#26 φ_j +Type not computed + +[0] → #21 ASSOC +[1] → #20 DATA +[2] → #34 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #21</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n27" data-id="27" transform="translate(415,848)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #27</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#27 < +Type not computed + +[0] → — DATA +[1] → #26 DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n28" data-id="28" transform="translate(148,952)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #28</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#28 If +Type not computed + +[0] → #21 CTRL +[1] → #27 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n32" data-id="32" transform="translate(274,848)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #32</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#32 + +Type not computed + +[0] → — DATA +[1] → #26 DATA +[2] → #24 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n33" data-id="33" transform="translate(1190,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #33</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#33 1 +Type not computed + +</title></g><g class="node" id="n34" data-id="34" transform="translate(567,848)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #34</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#34 + +Type not computed + +[0] → — DATA +[1] → #26 DATA +[2] → #33 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n35" data-id="35" transform="translate(752,1184)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #35</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#35 Return +Type not computed + +[0] → #9 CTRL +[1] → #11 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(72,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><title>Loop · 17 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(116,640)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #21</tspan></text><title>Loop · 9 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #21"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter07/docs/07-graph4.json b/chapter07/docs/07-graph4.json new file mode 100644 index 00000000..a9848505 --- /dev/null +++ b/chapter07/docs/07-graph4.json @@ -0,0 +1,37 @@ +{ + "ver": 1, + "comp": "chapter07/docs/07-graph4.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 30, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}], "proj": {"par": 15, "idx": 0}}, + {"id": 5, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}], "proj": {"par": 15, "idx": 1}}, + {"id": 6, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 27, "role": "CTRL", "label": null}], "proj": null}, + {"id": 9, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": {"par": 21, "idx": 0}}, + {"id": 10, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": {"par": 21, "idx": 1}}, + {"id": 11, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 8, "role": "ASSOC", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 28, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 8, "role": "ASSOC", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 29, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 14, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 20, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}, {"idx": 2, "def": 19, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 4, "role": "CTRL", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}], "proj": null}, + {"id": 25, "label": "3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 26, "label": "4", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 27, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "CTRL", "label": null}, {"idx": 2, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 28, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 27, "role": "ASSOC", "label": null}, {"idx": 1, "def": 25, "role": "DATA", "label": null}, {"idx": 2, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 29, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 27, "role": "ASSOC", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}, {"idx": 2, "def": 26, "role": "DATA", "label": null}], "proj": null}, + {"id": 30, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [4, 5, 8, 11, 12, 14, 15]}, + {"id": 21, "par": 8, "nodes": [9, 10, 20, 21, 27, 28, 29]} + ] +} diff --git a/chapter07/docs/07-graph4.svg b/chapter07/docs/07-graph4.svg index cf42453d..0fc498f7 100644 --- a/chapter07/docs/07-graph4.svg +++ b/chapter07/docs/07-graph4.svg @@ -1,329 +1,159 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter07 Pages: 1 --> -<svg width="394pt" height="545pt" - viewBox="0.00 0.00 394.00 545.35" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 541.35)"> -<title>chapter07</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-541.35 390,-541.35 390,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-33.35 8,-529.35 378,-529.35 378,-33.35 8,-33.35"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="312,-492.35 312,-517.35 362,-517.35 362,-492.35 312,-492.35"/> -<polygon fill="none" stroke="black" points="312,-492.35 312,-517.35 362,-517.35 362,-492.35 312,-492.35"/> -<text text-anchor="start" x="318.5" y="-501.15" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="312,-461.35 312,-492.35 362,-492.35 362,-461.35 312,-461.35"/> -<polygon fill="yellow" stroke="transparent" points="317,-466.35 317,-487.35 357,-487.35 357,-466.35 317,-466.35"/> -<polygon fill="none" stroke="black" points="317,-466.35 317,-487.35 357,-487.35 357,-466.35 317,-466.35"/> -<text text-anchor="start" x="320" y="-473.15" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="370,-77.35 316,-77.35 316,-41.35 370,-41.35 370,-77.35"/> -<text text-anchor="middle" x="343" y="-55.65" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return30 --> -<g id="node19" class="node"> -<title>Return30</title> -<polygon fill="yellow" stroke="black" points="370,-163.35 304,-163.35 304,-127.35 370,-127.35 370,-163.35"/> -<text text-anchor="middle" x="337" y="-141.65" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return30 --> -<g id="edge1" class="edge"> -<title>Stop3->Return30</title> -<path fill="none" stroke="red" d="M341.76,-77.75C340.95,-89.09 339.87,-104.12 338.95,-117.03"/> -<polygon fill="red" stroke="red" points="335.44,-117.03 338.22,-127.25 342.42,-117.53 335.44,-117.03"/> -<text text-anchor="middle" x="338.76" y="-80.35" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="196" cy="-489.35" rx="27" ry="18"/> -<text text-anchor="middle" x="196" y="-485.65" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Con_7 --> -<g id="node4" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="124" cy="-489.35" rx="27" ry="18"/> -<text text-anchor="middle" x="124" y="-485.65" font-family="Times,serif" font-size="14.00">2</text> -</g> -<!-- Loop8 --> -<g id="node5" class="node"> -<title>Loop8</title> -<polygon fill="yellow" stroke="black" points="367,-421.35 313,-421.35 313,-385.35 367,-385.35 367,-421.35"/> -<text text-anchor="middle" x="340" y="-399.65" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop8->Start2 --> -<g id="edge2" class="edge"> -<title>Loop8->Start2:p0</title> -<path fill="none" stroke="red" d="M338.71,-421.43C338.08,-430.88 337.4,-443.1 337.13,-455.02"/> -<polygon fill="red" stroke="red" points="333.62,-455.3 337,-465.35 340.62,-455.39 333.62,-455.3"/> -<text text-anchor="middle" x="335.71" y="-424.03" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region27 --> -<g id="node16" class="node"> -<title>Region27</title> -<polygon fill="yellow" stroke="black" points="298,-77.35 232,-77.35 232,-41.35 298,-41.35 298,-77.35"/> -<text text-anchor="middle" x="265" y="-55.65" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Loop8->Region27 --> -<g id="edge3" class="edge"> -<title>Loop8->Region27</title> -<path fill="none" stroke="red" d="M312.6,-389.27C286.36,-376.62 248.79,-358.1 235,-349.35 191.17,-321.51 165.74,-324.02 143,-277.35 130.54,-251.78 139.66,-241.59 143,-213.35 145.69,-190.65 153.07,-131.47 167,-113.35 174.64,-103.41 199.67,-89.94 222.53,-79.07"/> -<polygon fill="red" stroke="red" points="224.22,-82.15 231.8,-74.74 221.25,-75.8 224.22,-82.15"/> -<text text-anchor="middle" x="309.6" y="-382.87" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a11 --> -<g id="node6" class="node"> -<title>Phi_a11</title> -<ellipse fill="lightyellow" stroke="black" cx="196" cy="-403.35" rx="27" ry="18"/> -<text text-anchor="middle" x="196" y="-399.65" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_a11->Con_6 --> -<g id="edge5" class="edge"> -<title>Phi_a11->Con_6</title> -<path fill="none" stroke="black" d="M196,-421.75C196,-433.09 196,-448.12 196,-461.03"/> -<polygon fill="black" stroke="black" points="192.5,-461.25 196,-471.25 199.5,-461.25 192.5,-461.25"/> -<text text-anchor="middle" x="193" y="-424.35" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a11->Loop8 --> -<g id="edge4" class="edge"> -<title>Phi_a11->Loop8</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M210.22,-387.78C218.37,-380.03 229.29,-371.45 241,-367.35 263.65,-359.4 272.35,-359.4 295,-367.35 302.14,-369.85 308.99,-374.02 315.09,-378.65"/> -<polygon fill="black" stroke="black" points="312.99,-381.44 322.92,-385.13 317.45,-376.05 312.99,-381.44"/> -<text text-anchor="middle" x="207.22" y="-381.38" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_a28 --> -<g id="node17" class="node"> -<title>Phi_a28</title> -<ellipse fill="lightyellow" stroke="black" cx="187" cy="-59.35" rx="27" ry="18"/> -<text text-anchor="middle" x="187" y="-55.65" font-family="Times,serif" font-size="14.00">φ_a</text> -</g> -<!-- Phi_b12 --> -<g id="node7" class="node"> -<title>Phi_b12</title> -<ellipse fill="lightyellow" stroke="black" cx="124" cy="-403.35" rx="27.1" ry="18"/> -<text text-anchor="middle" x="124" y="-399.65" font-family="Times,serif" font-size="14.00">φ_b</text> -</g> -<!-- Phi_b12->Con_7 --> -<g id="edge8" class="edge"> -<title>Phi_b12->Con_7</title> -<path fill="none" stroke="black" d="M124,-421.75C124,-433.09 124,-448.12 124,-461.03"/> -<polygon fill="black" stroke="black" points="120.5,-461.25 124,-471.25 127.5,-461.25 120.5,-461.25"/> -<text text-anchor="middle" x="121" y="-424.35" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_b12->Loop8 --> -<g id="edge7" class="edge"> -<title>Phi_b12->Loop8</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M138.22,-387.78C146.37,-380.03 157.29,-371.45 169,-367.35 221.84,-348.81 242.16,-348.81 295,-367.35 302.14,-369.85 308.99,-374.02 315.09,-378.65"/> -<polygon fill="black" stroke="black" points="312.99,-381.44 322.92,-385.13 317.45,-376.05 312.99,-381.44"/> -<text text-anchor="middle" x="135.22" y="-381.38" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_b29 --> -<g id="node18" class="node"> -<title>Phi_b29</title> -<ellipse fill="lightyellow" stroke="black" cx="43" cy="-59.35" rx="27.1" ry="18"/> -<text text-anchor="middle" x="43" y="-55.65" font-family="Times,serif" font-size="14.00">φ_b</text> -</g> -<!-- Con_13 --> -<g id="node8" class="node"> -<title>Con_13</title> -<ellipse fill="none" stroke="black" cx="268" cy="-403.35" rx="27" ry="18"/> -<text text-anchor="middle" x="268" y="-399.65" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT14 --> -<g id="node9" class="node"> -<title>LT14</title> -<ellipse fill="none" stroke="black" cx="271" cy="-331.35" rx="27" ry="18"/> -<text text-anchor="middle" x="271" y="-327.65" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT14->Phi_a11 --> -<g id="edge10" class="edge"> -<title>LT14->Phi_a11</title> -<path fill="none" stroke="black" d="M255.82,-346.51C245.15,-356.47 230.68,-369.98 218.65,-381.21"/> -<polygon fill="black" stroke="black" points="216.08,-378.82 211.15,-388.2 220.85,-383.94 216.08,-378.82"/> -<text text-anchor="middle" x="252.82" y="-349.11" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT14->Con_13 --> -<g id="edge11" class="edge"> -<title>LT14->Con_13</title> -<path fill="none" stroke="black" d="M270.26,-349.65C269.93,-357.36 269.53,-366.63 269.16,-375.23"/> -<polygon fill="black" stroke="black" points="265.66,-375.1 268.73,-385.24 272.66,-375.4 265.66,-375.1"/> -<text text-anchor="middle" x="267.26" y="-352.25" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If15 --> -<g id="node10" class="node"> -<title>If15</title> -<polygon fill="yellow" stroke="transparent" points="260,-248.35 260,-273.35 354,-273.35 354,-248.35 260,-248.35"/> -<polygon fill="none" stroke="black" points="260,-248.35 260,-273.35 354,-273.35 354,-248.35 260,-248.35"/> -<text text-anchor="start" x="301.5" y="-257.15" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="260,-217.35 260,-248.35 354,-248.35 354,-217.35 260,-217.35"/> -<polygon fill="yellow" stroke="transparent" points="265,-222.35 265,-243.35 305,-243.35 305,-222.35 265,-222.35"/> -<polygon fill="none" stroke="black" points="265,-222.35 265,-243.35 305,-243.35 305,-222.35 265,-222.35"/> -<text text-anchor="start" x="268" y="-229.15" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="305,-222.35 305,-243.35 349,-243.35 349,-222.35 305,-222.35"/> -<polygon fill="none" stroke="black" points="305,-222.35 305,-243.35 349,-243.35 349,-222.35 305,-222.35"/> -<text text-anchor="start" x="308" y="-229.15" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If15->Loop8 --> -<g id="edge12" class="edge"> -<title>If15->Loop8</title> -<path fill="none" stroke="red" d="M314.79,-277.64C317.5,-288.87 320.49,-301.65 323,-313.35 327.43,-333.98 331.89,-357.43 335.12,-375.08"/> -<polygon fill="red" stroke="red" points="331.74,-376.02 336.97,-385.24 338.63,-374.77 331.74,-376.02"/> -<text text-anchor="middle" x="311.79" y="-280.24" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If15->LT14 --> -<g id="edge13" class="edge"> -<title>If15->LT14</title> -<path fill="none" stroke="black" d="M293.59,-277.62C289.8,-286.48 285.72,-296.01 282.08,-304.5"/> -<polygon fill="black" stroke="black" points="278.78,-303.32 278.05,-313.89 285.21,-306.08 278.78,-303.32"/> -<text text-anchor="middle" x="290.59" y="-280.22" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_19 --> -<g id="node11" class="node"> -<title>Con_19</title> -<ellipse fill="none" stroke="black" cx="130" cy="-331.35" rx="27" ry="18"/> -<text text-anchor="middle" x="130" y="-327.65" font-family="Times,serif" font-size="14.00">2</text> -</g> -<!-- EQ20 --> -<g id="node12" class="node"> -<title>EQ20</title> -<ellipse fill="none" stroke="black" cx="179" cy="-245.35" rx="27" ry="18"/> -<text text-anchor="middle" x="179" y="-241.65" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ20->Phi_a11 --> -<g id="edge14" class="edge"> -<title>EQ20->Phi_a11</title> -<path fill="none" stroke="black" d="M180.85,-263.34C183.79,-290.3 189.54,-343.11 193.05,-375.31"/> -<polygon fill="black" stroke="black" points="189.59,-375.81 194.15,-385.38 196.55,-375.06 189.59,-375.81"/> -<text text-anchor="middle" x="177.85" y="-265.94" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ20->Con_19 --> -<g id="edge15" class="edge"> -<title>EQ20->Con_19</title> -<path fill="none" stroke="black" d="M169.55,-262.54C162.5,-274.63 152.74,-291.37 144.67,-305.19"/> -<polygon fill="black" stroke="black" points="141.43,-303.8 139.42,-314.2 147.48,-307.33 141.43,-303.8"/> -<text text-anchor="middle" x="166.55" y="-265.14" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If21 --> -<g id="node13" class="node"> -<title>If21</title> -<polygon fill="yellow" stroke="transparent" points="184,-148.35 184,-173.35 278,-173.35 278,-148.35 184,-148.35"/> -<polygon fill="none" stroke="black" points="184,-148.35 184,-173.35 278,-173.35 278,-148.35 184,-148.35"/> -<text text-anchor="start" x="225.5" y="-157.15" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="184,-117.35 184,-148.35 278,-148.35 278,-117.35 184,-117.35"/> -<polygon fill="yellow" stroke="transparent" points="189,-122.35 189,-143.35 229,-143.35 229,-122.35 189,-122.35"/> -<polygon fill="none" stroke="black" points="189,-122.35 189,-143.35 229,-143.35 229,-122.35 189,-122.35"/> -<text text-anchor="start" x="192" y="-129.15" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="229,-122.35 229,-143.35 273,-143.35 273,-122.35 229,-122.35"/> -<polygon fill="none" stroke="black" points="229,-122.35 229,-143.35 273,-143.35 273,-122.35 229,-122.35"/> -<text text-anchor="start" x="232" y="-129.15" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If21->If15 --> -<g id="edge16" class="edge"> -<title>If21->If15:p0</title> -<path fill="none" stroke="red" d="M266.11,-177.35C274.25,-187.13 281.31,-198.68 283.92,-211.16"/> -<polygon fill="red" stroke="red" points="280.47,-211.77 285,-221.35 287.43,-211.03 280.47,-211.77"/> -<text text-anchor="middle" x="263.11" y="-179.95" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If21->EQ20 --> -<g id="edge17" class="edge"> -<title>If21->EQ20</title> -<path fill="none" stroke="black" d="M214.55,-177.35C207.43,-190.76 199.21,-206.25 192.47,-218.96"/> -<polygon fill="black" stroke="black" points="189.24,-217.58 187.65,-228.05 195.42,-220.86 189.24,-217.58"/> -<text text-anchor="middle" x="211.55" y="-179.95" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_25 --> -<g id="node14" class="node"> -<title>Con_25</title> -<ellipse fill="none" stroke="black" cx="111" cy="-145.35" rx="27" ry="18"/> -<text text-anchor="middle" x="111" y="-141.65" font-family="Times,serif" font-size="14.00">3</text> -</g> -<!-- Con_26 --> -<g id="node15" class="node"> -<title>Con_26</title> -<ellipse fill="none" stroke="black" cx="115" cy="-59.35" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-55.65" font-family="Times,serif" font-size="14.00">4</text> -</g> -<!-- Region27->If21 --> -<g id="edge18" class="edge"> -<title>Region27->If21:p0</title> -<path fill="none" stroke="red" d="M236.34,-77.55C225.26,-86.1 214.31,-97.52 210.45,-111.09"/> -<polygon fill="red" stroke="red" points="206.94,-110.95 209,-121.35 213.87,-111.94 206.94,-110.95"/> -<text text-anchor="middle" x="233.34" y="-80.15" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region27->If21 --> -<g id="edge19" class="edge"> -<title>Region27->If21:p1</title> -<path fill="none" stroke="red" d="M258.9,-77.46C255.95,-86.91 252.79,-99.16 251.55,-111.27"/> -<polygon fill="red" stroke="red" points="248.05,-111.17 251,-121.35 255.04,-111.55 248.05,-111.17"/> -<text text-anchor="middle" x="255.9" y="-80.06" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a28->Phi_a11 --> -<g id="edge22" class="edge"> -<title>Phi_a28->Phi_a11</title> -<path fill="none" stroke="black" d="M156.38,-74.81C123.24,-90.46 75.08,-113.23 75,-113.35 59.78,-137.38 66.63,-150.16 75,-177.35 90.81,-228.71 98.49,-247.23 143,-277.35 204.81,-319.16 260.23,-255.2 307,-313.35 317.03,-325.81 315.54,-335.81 307,-349.35 306.7,-349.82 259.29,-372.35 226.54,-387.88"/> -<polygon fill="black" stroke="black" points="158.14,-77.85 165.69,-70.41 155.15,-71.52 158.14,-77.85"/> -<polygon fill="black" stroke="black" points="224.86,-384.81 217.32,-392.25 227.86,-391.13 224.86,-384.81"/> -<text text-anchor="middle" x="162.69" y="-73.01" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_a28->Con_25 --> -<g id="edge21" class="edge"> -<title>Phi_a28->Con_25</title> -<path fill="none" stroke="black" d="M173.41,-75.36C161.74,-88.26 144.74,-107.05 131.43,-121.77"/> -<polygon fill="black" stroke="black" points="128.58,-119.7 124.47,-129.46 133.77,-124.39 128.58,-119.7"/> -<text text-anchor="middle" x="170.41" y="-77.96" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_a28->Region27 --> -<g id="edge20" class="edge"> -<title>Phi_a28->Region27</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M214.12,-59.35C216.58,-59.35 219.04,-59.35 221.5,-59.35"/> -<polygon fill="black" stroke="black" points="221.61,-62.85 231.61,-59.35 221.61,-55.85 221.61,-62.85"/> -<text text-anchor="middle" x="217.12" y="-52.95" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_b29->Phi_b12 --> -<g id="edge24" class="edge"> -<title>Phi_b29->Phi_b12</title> -<path fill="none" stroke="black" d="M44.59,-87.64C48.34,-139.92 60.11,-257.16 94,-349.35 97.54,-358.97 102.7,-368.9 107.74,-377.53"/> -<polygon fill="black" stroke="black" points="48.07,-87.25 43.91,-77.51 41.09,-87.72 48.07,-87.25"/> -<polygon fill="black" stroke="black" points="104.9,-379.59 113.09,-386.31 110.88,-375.95 104.9,-379.59"/> -<text text-anchor="middle" x="40.91" y="-80.11" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_b29->Con_26 --> -<g id="edge25" class="edge"> -<title>Phi_b29->Con_26</title> -<path fill="none" stroke="black" d="M70.56,-59.35C73,-59.35 75.44,-59.35 77.89,-59.35"/> -<polygon fill="black" stroke="black" points="77.92,-62.85 87.92,-59.35 77.92,-55.85 77.92,-62.85"/> -<text text-anchor="middle" x="73.56" y="-52.95" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_b29->Region27 --> -<g id="edge23" class="edge"> -<title>Phi_b29->Region27</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M54.68,-42.66C62.75,-32.67 74.44,-20.87 88,-15.35 139.86,5.79 161.51,4.17 214,-15.35 224.63,-19.3 234.53,-26.57 242.72,-34.08"/> -<polygon fill="black" stroke="black" points="240.44,-36.75 250.02,-41.26 245.34,-31.75 240.44,-36.75"/> -<text text-anchor="middle" x="51.68" y="-36.26" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return30->Phi_b12 --> -<g id="edge27" class="edge"> -<title>Return30->Phi_b12</title> -<path fill="none" stroke="black" d="M313.98,-163.53C307.84,-168.06 301.19,-172.92 295,-177.35 272.13,-193.69 260.87,-191.65 243,-213.35 223.27,-237.31 230.02,-250.17 215,-277.35 196.27,-311.22 188.92,-318.16 166,-349.35 158.65,-359.34 150.22,-370.11 142.84,-379.32"/> -<polygon fill="black" stroke="black" points="139.98,-377.29 136.43,-387.27 145.43,-381.68 139.98,-377.29"/> -<text text-anchor="middle" x="310.98" y="-166.13" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return30->If15 --> -<g id="edge26" class="edge"> -<title>Return30->If15:p1</title> -<path fill="none" stroke="red" d="M333.39,-163.54C331,-176.2 328.14,-194.14 327.27,-211.34"/> -<polygon fill="red" stroke="red" points="323.77,-211.26 327,-221.35 330.76,-211.44 323.77,-211.26"/> -<text text-anchor="middle" x="330.39" y="-166.14" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1151" height="1270" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1151 1270" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="813" height="890" fill="#f1f6fc"/></g><g class="region" transform="translate(271,632)"><rect class="region-box" rx="8" width="512" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M269,1169 C269,1193 575.5,1196 575.5,1220" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #30 · CTRL</title></path><path class="edge CTRL" id="e8i1" d="M149,118 L149,271" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e8i2" d="M407,971 L407,981 L825,981 L825,246 L179,246 L179,274" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[2] → #27 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M307,118 L307,128 L281,128 L281,271" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #6 · DATA</title></path><path class="edge DATA" id="e11i2" d="M559,971 L559,981 L815,981 L815,254 L321,254 L321,274" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[2] → #28 · DATA</title></path><path class="edge DATA" id="e12i1" d="M459,118 L459,128 L433,128 L433,271" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #7 · DATA</title></path><path class="edge DATA" id="e12i2" d="M711,971 L711,981 L805,981 L805,262 L473,262 L473,274" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[2] → #29 · DATA</title></path><path class="edge DATA" id="e14i1" d="M301,327 L301,357 L255,357 L255,375" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #11 · DATA</title></path><path class="edge DATA" id="e14i2" d="M611,118 L611,128 L523,128 L523,337 L285,337 L285,375" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge CTRL" id="e15i0" d="M149,327 L149,479" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#15[0] → #8 · CTRL</title></path><path class="edge DATA" id="e15i1" d="M255,431 L255,441 L229,441 L229,479" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#15[1] → #14 · DATA</title></path><path class="edge DATA" id="e20i1" d="M301,327 L301,357 L443,357 L443,666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[1] → #11 · DATA</title></path><path class="edge DATA" id="e20i2" d="M763,118 L763,138 L534,138 L534,589 L473,589 L473,666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[2] → #19 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M129,579 L129,599 L363,599 L363,770" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #4 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M443,722 L443,770" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #20 · DATA</title></path><path class="edge CTRL" id="e27i1" d="M343,870 L343,880 L407,880 L407,918" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#27[1] → #9 · CTRL</title></path><path class="edge CTRL" id="e27i2" d="M463,870 L463,880 L437,880 L437,918" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#27[2] → #10 · CTRL</title></path><path class="edge DATA" id="e28i1" d="M915,118 L915,148 L545,148 L545,589 L539,589 L539,918" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#28[1] → #25 · DATA</title></path><path class="edge DATA" id="e28i2" d="M301,327 L301,357 L579,357 L579,918" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#28[2] → #11 · DATA</title></path><path class="edge DATA" id="e29i1" d="M453,327 L453,347 L590,347 L590,589 L691,589 L691,918" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#29[1] → #12 · DATA</title></path><path class="edge DATA" id="e29i2" d="M1067,118 L1067,158 L731,158 L731,918" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#29[2] → #26 · DATA</title></path><path class="edge CTRL" id="e30i0" d="M249,579 L249,1116" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#30[0] → #5 · CTRL</title></path><path class="edge DATA" id="e30i1" d="M453,327 L453,347 L325,347 L325,589 L260,589 L260,1078 L289,1078 L289,1116" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#30[1] → #12 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(89,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(89,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(539.5,1220)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #30 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(69,529)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #4/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 True +Projection 0 of #15 +Type not computed + +[0] → #15 CTRL</title></g><g class="node" id="n5" data-id="5" transform="translate(189,529)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #5/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 False +Projection 1 of #15 +Type not computed + +[0] → #15 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(247,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 1 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(399,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>2</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 2 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(89,277)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #27 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(283,820)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #9/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 True +Projection 0 of #21 +Type not computed + +[0] → #21 CTRL</title></g><g class="node" id="n10" data-id="10" transform="translate(403,820)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 False +Projection 1 of #21 +Type not computed + +[0] → #21 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(241,277)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 φ_a +Type not computed + +[0] → #8 ASSOC +[1] → #6 DATA +[2] → #28 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #8</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(393,277)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_b</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 φ_b +Type not computed + +[0] → #8 ASSOC +[1] → #7 DATA +[2] → #29 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #8</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n13" data-id="13" transform="translate(551,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 10 +Type not computed + +</title></g><g class="node" id="n14" data-id="14" transform="translate(195,381)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 < +Type not computed + +[0] → — DATA +[1] → #11 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(69,485)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#15 If +Type not computed + +[0] → #8 CTRL +[1] → #14 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n19" data-id="19" transform="translate(703,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>2</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#19 2 +Type not computed + +</title></g><g class="node" id="n20" data-id="20" transform="translate(383,672)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 == +Type not computed + +[0] → — DATA +[1] → #11 DATA +[2] → #19 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n21" data-id="21" transform="translate(283,776)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#21 If +Type not computed + +[0] → #4 CTRL +[1] → #20 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n25" data-id="25" transform="translate(855,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>3</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 3 +Type not computed + +</title></g><g class="node" id="n26" data-id="26" transform="translate(1007,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>4</tspan><tspan class="node-id">  #26</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#26 4 +Type not computed + +</title></g><g class="node" id="n27" data-id="27" transform="translate(347,924)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #27</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#27 Region +Type not computed + +[0] → — DATA +[1] → #9 CTRL +[2] → #10 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n28" data-id="28" transform="translate(499,924)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_a</tspan><tspan class="node-id">  #28</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#28 φ_a +Type not computed + +[0] → #27 ASSOC +[1] → #25 DATA +[2] → #11 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #27</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n29" data-id="29" transform="translate(651,924)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_b</tspan><tspan class="node-id">  #29</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#29 φ_b +Type not computed + +[0] → #27 ASSOC +[1] → #12 DATA +[2] → #26 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #27</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n30" data-id="30" transform="translate(209,1122)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #30</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#30 Return +Type not computed + +[0] → #5 CTRL +[1] → #12 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,173)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><title>Loop · 14 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(271,632)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #21</tspan></text><title>If · 7 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #21"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter07/docs/Makefile b/chapter07/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter07/docs/Makefile +++ b/chapter07/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter08/README.md b/chapter08/README.md index f1718fbb..46e4eeca 100644 --- a/chapter08/README.md +++ b/chapter08/README.md @@ -1,18 +1,20 @@ # Chapter 8: Lazy Phis, Break, Continue, and Evaluator +[Previous: Chapter 7](../chapter07/README.md) | +[Next: Chapter 9](../chapter09/README.md) + # Table of Contents 1. [Lazy Phi Creation](#lazy-phi-creation) 2. [Continue statement](#continue-statement) 3. [Break statement](#break-statement) -4. [Parser Considerations ](#parser-considerations) -5. [Identification of Basic Blocks in SoN graph](#identification-of-basic-blocks-in-son-graph) -6. [Examples](#examples) - -[Example 1](#example-1) - -[Example 2](#example-2) - -[Example 3](#example-3) +4. [Parser Considerations](#parser-considerations) +5. [Examples](#examples) + - [Example 1](#example-1) + - [Example 2](#example-2) + - [Example 3](#example-3) -7. [Sea of Nodes Graph Evaluator](#sea-of-nodes-graph-evaluator) +6. [Sea of Nodes Graph Evaluator](#sea-of-nodes-graph-evaluator) You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter08) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter07...linear-chapter08) it to the previous chapter. @@ -68,7 +70,7 @@ We do this as follows: ? loop.in(idx) // Set real Phi in the loop head // The phi takes its one input (no backedge yet) from a recursive - // lookup, which might have insert a Phi in every loop nest. + // lookup, which might have inserted a Phi in every loop nest. : loop.setDef(idx,new PhiNode(name,loop.ctrl(),loop.update(name,null,nestingLevel),null).peephole()); setDef(idx,old); } @@ -80,7 +82,7 @@ We do this as follows: ```java if( in(i) != that.in(i) ) // No need for redundant Phis - // If we are in lazy phi mode we need to a lookup + // If we are in lazy phi mode we need to do a lookup // by name as it will trigger a phi creation setDef(i, new PhiNode(ns[i], r, this.lookup(ns[i]), that.lookup(ns[i])).peephole()); ``` @@ -105,7 +107,7 @@ We do this as follows: ## `continue` Statement -In chapter7, we had a single backedge from the loop's end flowing back to the +In Chapter 7, we had a single backedge from the loop's end flowing back to the loop head. With the addition of a `continue` statement, we can have multiple backedges @@ -115,10 +117,10 @@ We have several ways of implementing these backedges. 1. The traditional way would be to let each backedge from `continue` merge into the loop head. Phis would require as many inputs as there are edges. The - downside is now are Loops are not simply nested. This makes it difficult to + downside is now our Loops are not simply nested. This makes it difficult to do many kinds of peephole-based loop optimizations, such as "partially rolling" the loop to allow more loop invariants to get hoisted. -2. An alternative is collect all `continue`s at a single merge point (`Region`) +2. An alternative is to collect all `continue`s at a single merge point (`Region`) and then create a single backedge flowing from the continue `Region` to the loop head. 3. A third approach is to create a stack of continue `Region`s rather than a @@ -148,7 +150,7 @@ scope into it to generate a continue Scope and `Region`. Subsequently, when we see another `continue`, we need to construct a new `Region` and merge the previous continue Scope with the current Scope. -The implementation is a variation of above. +The implementation is a variation of the above. * The first `continue` triggers a dupe of the current scope; we prune any nested lexical scopes deeper than the head scope, removing any name bindings @@ -274,11 +276,11 @@ With that brief setup done, the control projection from the Start node is traver At this point, control flow is at the first region of the program, but it is treated just the same as any other region. There are two things that must be done at each region. First, resolve all phis to a specific value; and second to determine where control flow will continue to. -It may seem like more than that should be done, but by resolving phi nodes, any logic that is specific to the control flow path for the given will be resolved. Any other work will eventually be resolved later on as-needed. This is sufficient for the program to run! +It may seem like more than that should be done, but by resolving phi nodes, any logic that is specific to the control flow path for the given region will be resolved. Any other work will eventually be resolved later on as-needed. This is sufficient for the program to run! Finding the next place control flow will move to after a region is straightforward because any region only has a single control node that uses it. So we search for that node in the Region's users. -Once we have that node, our behavior depends on what type of control flow node we've landed on. There are only 3 options: `RegionNode`, `IfNode`, and `ReturnNode`. If it is another `RegionNode`, we do the same again. If it's a `ReturnNode`, we can resolve the returned expression and return the program's value. Finally, for an `IfNode`, we must first resolve the test expression so that we can choose the false (projection 0) or true (projection 1) branch. Whichever projection from the `IfNode` is chosen, we step through that projection on to the control node (a `RegionNode`) that uses it. +Once we have that node, our behavior depends on what type of control flow node we've landed on. There are only 3 options: `RegionNode`, `IfNode`, and `ReturnNode`. If it is another `RegionNode`, we do the same again. If it's a `ReturnNode`, we can resolve the returned expression and return the program's value. Finally, for an `IfNode`, we must first resolve the test expression so that we can choose the true (projection 0) or false (projection 1) branch. Whichever projection from the `IfNode` is chosen, we step through that projection on to the control node (a `RegionNode`) that uses it. We talk about resolving nodes above, but what does that mean? A node will either have a value (for instance a constant), will already be resolved with the resolved value cached, or it will operate on nodes that it uses, which must be resolved. Once a node's inputs are resolved, its operation may be performed on them. For instance, an `AddNode`'s value will be the sum of its two inputs. Once the value is resolved, the resolved value is returned. @@ -289,7 +291,7 @@ Looping is almost functional with that, too, with only a couple of small extra d Finally, while calculating the value of `PhiNode`s in the loop region, we must be careful to compute all of their new values before we update any of their cached values. That's because as a loop iterates, we must ensure that all `PhiNode` values are consistently the value from the same point in time. Once all of the new values are calculated, we can update the cache for all of them at once. To illustrate this, consider the following code: ```java -t = 0; +int t = 0; while(arg < 10) { t = arg; arg = arg + 1; @@ -309,4 +311,4 @@ arg=arg+arg; return arg; ``` -On the other hand, this engine is not designed to be particularly fast! Because not all expressions are cached, it's possible to construct programs like the preceeding one which have exponential runtime. +On the other hand, this engine is not designed to be particularly fast! Because not all expressions are cached, it's possible to construct programs like the preceding one which have exponential runtime. diff --git a/chapter08/docs/08-graph1.json b/chapter08/docs/08-graph1.json new file mode 100644 index 00000000..130a79bd --- /dev/null +++ b/chapter08/docs/08-graph1.json @@ -0,0 +1,39 @@ +{ + "ver": 1, + "comp": "chapter08/docs/08-graph1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 40, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 6, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 39, "role": "CTRL", "label": null}], "proj": null}, + {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 8, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 6, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": {"par": 19, "idx": 0}}, + {"id": 13, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": {"par": 19, "idx": 1}}, + {"id": 14, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 28, "role": "CTRL", "label": null}], "proj": {"par": 28, "idx": 0}}, + {"id": 15, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 18, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 17, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 28, "role": "CTRL", "label": null}], "proj": {"par": 28, "idx": 1}}, + {"id": 26, "label": "6", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 27, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 26, "role": "DATA", "label": null}], "proj": null}, + {"id": 28, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 13, "role": "CTRL", "label": null}, {"idx": 1, "def": 27, "role": "DATA", "label": null}], "proj": null}, + {"id": 34, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 7, "role": "CTRL", "label": null}, {"idx": 2, "def": 14, "role": "CTRL", "label": null}], "proj": null}, + {"id": 35, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 34, "role": "ASSOC", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 39, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "CTRL", "label": null}, {"idx": 2, "def": 20, "role": "CTRL", "label": null}], "proj": null}, + {"id": 40, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 34, "role": "CTRL", "label": null}, {"idx": 1, "def": 35, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 6, "par": 0, "nodes": [5, 6, 7, 8, 10, 11, 12, 13, 14, 18, 19, 20, 27, 28, 39]} + ] +} diff --git a/chapter08/docs/08-graph1.svg b/chapter08/docs/08-graph1.svg index 0f23a746..67630205 100644 --- a/chapter08/docs/08-graph1.svg +++ b/chapter08/docs/08-graph1.svg @@ -1,359 +1,174 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter08 Pages: 1 --> -<svg width="334pt" height="764pt" - viewBox="0.00 0.00 334.00 764.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 760)"> -<title>chapter08</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-760 330,-760 330,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-748 318,-748 318,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="80,-711 80,-736 161,-736 161,-711 80,-711"/> -<polygon fill="none" stroke="black" points="80,-711 80,-736 161,-736 161,-711 80,-711"/> -<text text-anchor="start" x="102" y="-719.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="80,-680 80,-711 161,-711 161,-680 80,-680"/> -<polygon fill="yellow" stroke="transparent" points="85,-685 85,-706 125,-706 125,-685 85,-685"/> -<polygon fill="none" stroke="black" points="85,-685 85,-706 125,-706 125,-685 85,-685"/> -<text text-anchor="start" x="88" y="-691.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="125,-685 125,-706 156,-706 156,-685 125,-685"/> -<text text-anchor="start" x="128" y="-691.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="130,-52 76,-52 76,-16 130,-16 130,-52"/> -<text text-anchor="middle" x="103" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return40 --> -<g id="node19" class="node"> -<title>Return40</title> -<polygon fill="yellow" stroke="black" points="136,-124 70,-124 70,-88 136,-88 136,-124"/> -<text text-anchor="middle" x="103" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return40 --> -<g id="edge1" class="edge"> -<title>Stop3->Return40</title> -<path fill="none" stroke="red" d="M103,-52.3C103,-60.02 103,-69.29 103,-77.89"/> -<polygon fill="red" stroke="red" points="99.5,-77.9 103,-87.9 106.5,-77.9 99.5,-77.9"/> -<text text-anchor="middle" x="100" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Loop6 --> -<g id="node3" class="node"> -<title>Loop6</title> -<polygon fill="yellow" stroke="black" points="70,-640 16,-640 16,-604 70,-604 70,-640"/> -<text text-anchor="middle" x="43" y="-618.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop6->Start2 --> -<g id="edge2" class="edge"> -<title>Loop6->Start2:p0</title> -<path fill="none" stroke="red" d="M45.16,-640.06C48.35,-658.19 56.02,-685.28 73.77,-692.93"/> -<polygon fill="red" stroke="red" points="73.5,-696.44 84,-695 74.89,-689.58 73.5,-696.44"/> -<text text-anchor="middle" x="42.16" y="-642.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region39 --> -<g id="node18" class="node"> -<title>Region39</title> -<polygon fill="yellow" stroke="black" points="268,-196 202,-196 202,-160 268,-160 268,-196"/> -<text text-anchor="middle" x="235" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Loop6->Region39 --> -<g id="edge3" class="edge"> -<title>Loop6->Region39</title> -<path fill="none" stroke="red" d="M34.42,-603.81C18.87,-570.32 -10.82,-494.13 7,-432 35.9,-331.24 54.86,-302.97 132,-232 141.73,-223.05 168.66,-209.3 192.54,-198.05"/> -<polygon fill="red" stroke="red" points="194.25,-201.11 201.84,-193.72 191.3,-194.77 194.25,-201.11"/> -<text text-anchor="middle" x="31.42" y="-597.41" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg8 --> -<g id="node4" class="node"> -<title>Phi_arg8</title> -<ellipse fill="lightyellow" stroke="black" cx="197" cy="-622" rx="37.09" ry="18"/> -<text text-anchor="middle" x="197" y="-618.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg8->Start2 --> -<g id="edge5" class="edge"> -<title>Phi_arg8->Start2:p1</title> -<path fill="none" stroke="black" d="M195.04,-640.06C192.05,-658.19 184.71,-685.28 167.15,-692.93"/> -<polygon fill="black" stroke="black" points="166.1,-689.57 157,-695 167.5,-696.43 166.1,-689.57"/> -<text text-anchor="middle" x="192.04" y="-642.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg8->Loop6 --> -<g id="edge4" class="edge"> -<title>Phi_arg8->Loop6</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M178.53,-606.01C168.46,-598.34 155.34,-589.98 142,-586 119,-579.14 110.65,-578.06 88,-586 80.86,-588.5 74.01,-592.67 67.91,-597.3"/> -<polygon fill="black" stroke="black" points="65.55,-594.71 60.08,-603.78 70.01,-600.1 65.55,-594.71"/> -<text text-anchor="middle" x="175.53" y="-599.61" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add16 --> -<g id="node9" class="node"> -<title>Add16</title> -<ellipse fill="none" stroke="black" cx="197" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="197" y="-546.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Con_9 --> -<g id="node5" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="115" cy="-622" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-618.3" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT10 --> -<g id="node6" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="99" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="99" y="-546.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg8 --> -<g id="edge7" class="edge"> -<title>LT10->Phi_arg8</title> -<path fill="none" stroke="black" d="M116.97,-563.84C131.47,-574.19 152.11,-588.94 168.8,-600.86"/> -<polygon fill="black" stroke="black" points="166.94,-603.83 177.12,-606.8 171.01,-598.14 166.94,-603.83"/> -<text text-anchor="middle" x="113.97" y="-566.44" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT10->Con_9 --> -<g id="edge8" class="edge"> -<title>LT10->Con_9</title> -<path fill="none" stroke="black" d="M102.87,-567.95C104.65,-575.74 106.81,-585.18 108.81,-593.92"/> -<polygon fill="black" stroke="black" points="105.41,-594.76 111.05,-603.72 112.24,-593.2 105.41,-594.76"/> -<text text-anchor="middle" x="99.87" y="-570.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11 --> -<g id="node7" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="24,-467 24,-492 118,-492 118,-467 24,-467"/> -<polygon fill="none" stroke="black" points="24,-467 24,-492 118,-492 118,-467 24,-467"/> -<text text-anchor="start" x="65.5" y="-475.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="24,-436 24,-467 118,-467 118,-436 24,-436"/> -<polygon fill="yellow" stroke="transparent" points="29,-441 29,-462 69,-462 69,-441 29,-441"/> -<polygon fill="none" stroke="black" points="29,-441 29,-462 69,-462 69,-441 29,-441"/> -<text text-anchor="start" x="32" y="-447.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="69,-441 69,-462 113,-462 113,-441 69,-441"/> -<polygon fill="none" stroke="black" points="69,-441 69,-462 113,-462 113,-441 69,-441"/> -<text text-anchor="start" x="72" y="-447.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If11->Loop6 --> -<g id="edge9" class="edge"> -<title>If11->Loop6</title> -<path fill="none" stroke="red" d="M65.4,-496.19C60.27,-524.77 52.76,-566.64 47.87,-593.86"/> -<polygon fill="red" stroke="red" points="44.4,-593.4 46.08,-603.86 51.29,-594.63 44.4,-593.4"/> -<text text-anchor="middle" x="62.4" y="-498.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT10 --> -<g id="edge10" class="edge"> -<title>If11->LT10</title> -<path fill="none" stroke="black" d="M81.43,-496.28C84.3,-504.9 87.39,-514.17 90.16,-522.49"/> -<polygon fill="black" stroke="black" points="86.87,-523.69 93.36,-532.07 93.51,-521.48 86.87,-523.69"/> -<text text-anchor="middle" x="78.43" y="-498.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node8" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="279" cy="-622" rx="27" ry="18"/> -<text text-anchor="middle" x="279" y="-618.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add16->Phi_arg8 --> -<g id="edge11" class="edge"> -<title>Add16->Phi_arg8</title> -<path fill="none" stroke="black" d="M197,-578.33C197,-583.31 197,-588.51 197,-593.49"/> -<polygon fill="black" stroke="black" points="200.5,-578.3 197,-568.3 193.5,-578.3 200.5,-578.3"/> -<polygon fill="black" stroke="black" points="193.5,-593.9 197,-603.9 200.5,-593.9 193.5,-593.9"/> -<text text-anchor="middle" x="194" y="-570.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16->Con_15 --> -<g id="edge12" class="edge"> -<title>Add16->Con_15</title> -<path fill="none" stroke="black" d="M213.2,-564.83C225.18,-575.06 241.69,-589.15 255.18,-600.66"/> -<polygon fill="black" stroke="black" points="253.23,-603.61 263.11,-607.44 257.78,-598.28 253.23,-603.61"/> -<text text-anchor="middle" x="210.2" y="-567.43" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_17 --> -<g id="node10" class="node"> -<title>Con_17</title> -<ellipse fill="none" stroke="black" cx="269" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="269" y="-546.3" font-family="Times,serif" font-size="14.00">5</text> -</g> -<!-- EQ18 --> -<g id="node11" class="node"> -<title>EQ18</title> -<ellipse fill="none" stroke="black" cx="211" cy="-464" rx="27" ry="18"/> -<text text-anchor="middle" x="211" y="-460.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ18->Add16 --> -<g id="edge13" class="edge"> -<title>EQ18->Add16</title> -<path fill="none" stroke="black" d="M208.17,-482C206.25,-493.5 203.68,-508.93 201.49,-522.08"/> -<polygon fill="black" stroke="black" points="198.02,-521.59 199.83,-532.03 204.93,-522.74 198.02,-521.59"/> -<text text-anchor="middle" x="205.17" y="-484.6" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ18->Con_17 --> -<g id="edge14" class="edge"> -<title>EQ18->Con_17</title> -<path fill="none" stroke="black" d="M221.91,-480.8C230.5,-493.24 242.61,-510.78 252.4,-524.95"/> -<polygon fill="black" stroke="black" points="249.58,-527.03 258.14,-533.27 255.34,-523.05 249.58,-527.03"/> -<text text-anchor="middle" x="218.91" y="-483.4" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If19 --> -<g id="node12" class="node"> -<title>If19</title> -<polygon fill="yellow" stroke="transparent" points="116,-367 116,-392 210,-392 210,-367 116,-367"/> -<polygon fill="none" stroke="black" points="116,-367 116,-392 210,-392 210,-367 116,-367"/> -<text text-anchor="start" x="157.5" y="-375.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="116,-336 116,-367 210,-367 210,-336 116,-336"/> -<polygon fill="yellow" stroke="transparent" points="121,-341 121,-362 161,-362 161,-341 121,-341"/> -<polygon fill="none" stroke="black" points="121,-341 121,-362 161,-362 161,-341 121,-341"/> -<text text-anchor="start" x="124" y="-347.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="161,-341 161,-362 205,-362 205,-341 161,-341"/> -<polygon fill="none" stroke="black" points="161,-341 161,-362 205,-362 205,-341 161,-341"/> -<text text-anchor="start" x="164" y="-347.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If19->If11 --> -<g id="edge15" class="edge"> -<title>If19->If11:p0</title> -<path fill="none" stroke="red" d="M107.67,-379.11C81.91,-388.94 55.7,-404.9 50.1,-429.95"/> -<polygon fill="red" stroke="red" points="46.61,-429.68 49,-440 53.56,-430.44 46.61,-429.68"/> -<text text-anchor="middle" x="104.67" y="-372.71" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If19->EQ18 --> -<g id="edge16" class="edge"> -<title>If19->EQ18</title> -<path fill="none" stroke="black" d="M178.19,-396.01C184.75,-409.41 192.34,-424.91 198.57,-437.61"/> -<polygon fill="black" stroke="black" points="195.48,-439.27 203.02,-446.71 201.76,-436.19 195.48,-439.27"/> -<text text-anchor="middle" x="175.19" y="-398.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_26 --> -<g id="node13" class="node"> -<title>Con_26</title> -<ellipse fill="none" stroke="black" cx="283" cy="-464" rx="27" ry="18"/> -<text text-anchor="middle" x="283" y="-460.3" font-family="Times,serif" font-size="14.00">6</text> -</g> -<!-- EQ27 --> -<g id="node14" class="node"> -<title>EQ27</title> -<ellipse fill="none" stroke="black" cx="263" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="263" y="-360.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ27->Add16 --> -<g id="edge17" class="edge"> -<title>EQ27->Add16</title> -<path fill="none" stroke="black" d="M247.53,-378.95C241.28,-384.42 233.92,-390.65 227,-396 204.76,-413.19 191.76,-409.43 175,-432 166.37,-443.62 168.75,-449.02 165,-463"/> -<path fill="none" stroke="black" d="M165,-465C159.41,-485.86 169.21,-508.71 179.4,-525.31"/> -<polygon fill="black" stroke="black" points="176.59,-527.4 185,-533.83 182.43,-523.55 176.59,-527.4"/> -<text text-anchor="middle" x="244.53" y="-381.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ27->Con_26 --> -<g id="edge18" class="edge"> -<title>EQ27->Con_26</title> -<path fill="none" stroke="black" d="M266.48,-382.07C269.52,-396.97 273.99,-418.83 277.51,-436.08"/> -<polygon fill="black" stroke="black" points="274.13,-437.03 279.56,-446.13 280.99,-435.63 274.13,-437.03"/> -<text text-anchor="middle" x="263.48" y="-384.67" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If28 --> -<g id="node15" class="node"> -<title>If28</title> -<polygon fill="yellow" stroke="transparent" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<polygon fill="none" stroke="black" points="168,-267 168,-292 262,-292 262,-267 168,-267"/> -<text text-anchor="start" x="209.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="168,-236 168,-267 262,-267 262,-236 168,-236"/> -<polygon fill="yellow" stroke="transparent" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<polygon fill="none" stroke="black" points="173,-241 173,-262 213,-262 213,-241 173,-241"/> -<text text-anchor="start" x="176" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<polygon fill="none" stroke="black" points="213,-241 213,-262 257,-262 257,-241 213,-241"/> -<text text-anchor="start" x="216" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If28->If19 --> -<g id="edge19" class="edge"> -<title>If28->If19:p1</title> -<path fill="none" stroke="red" d="M195.1,-296.25C190.01,-306.42 185.49,-318.16 183.75,-330.03"/> -<polygon fill="red" stroke="red" points="180.26,-329.76 183,-340 187.24,-330.29 180.26,-329.76"/> -<text text-anchor="middle" x="192.1" y="-298.85" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If28->EQ27 --> -<g id="edge20" class="edge"> -<title>If28->EQ27</title> -<path fill="none" stroke="black" d="M230.19,-296.01C236.75,-309.41 244.34,-324.91 250.57,-337.61"/> -<polygon fill="black" stroke="black" points="247.48,-339.27 255.02,-346.71 253.76,-336.19 247.48,-339.27"/> -<text text-anchor="middle" x="227.19" y="-298.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region34 --> -<g id="node16" class="node"> -<title>Region34</title> -<polygon fill="yellow" stroke="black" points="92,-196 26,-196 26,-160 92,-160 92,-196"/> -<text text-anchor="middle" x="59" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region34->If11 --> -<g id="edge21" class="edge"> -<title>Region34->If11:p1</title> -<path fill="none" stroke="red" d="M60.73,-196.19C64.47,-232.93 73.83,-321.8 84,-396 86.16,-411.79 89.38,-417.84 90.55,-429.91"/> -<polygon fill="red" stroke="red" points="87.06,-430.17 91,-440 94.05,-429.85 87.06,-430.17"/> -<text text-anchor="middle" x="57.73" y="-198.79" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region34->If28 --> -<g id="edge22" class="edge"> -<title>Region34->If28:p0</title> -<path fill="none" stroke="red" d="M73.55,-196.06C91.73,-215.52 124.92,-245.31 161.58,-250.28"/> -<polygon fill="red" stroke="red" points="161.78,-253.81 172,-251 162.26,-246.82 161.78,-253.81"/> -<text text-anchor="middle" x="70.55" y="-198.66" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg35 --> -<g id="node17" class="node"> -<title>Phi_arg35</title> -<ellipse fill="lightyellow" stroke="black" cx="147" cy="-178" rx="37.09" ry="18"/> -<text text-anchor="middle" x="147" y="-174.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg35->Phi_arg8 --> -<g id="edge24" class="edge"> -<title>Phi_arg35->Phi_arg8</title> -<path fill="none" stroke="black" d="M136.87,-195.37C115.38,-232.36 69.47,-324.71 99,-396 107.66,-416.91 124.41,-412 135,-432 163.81,-486.38 137.45,-511.15 161,-568 165.15,-578.02 171.36,-588.09 177.46,-596.73"/> -<polygon fill="black" stroke="black" points="174.69,-598.87 183.44,-604.83 180.32,-594.71 174.69,-598.87"/> -<text text-anchor="middle" x="133.87" y="-197.97" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg35->Add16 --> -<g id="edge25" class="edge"> -<title>Phi_arg35->Add16</title> -<path fill="none" stroke="black" d="M175.64,-189.71C213.39,-203.94 275.5,-227.79 279,-232 307.96,-266.86 294.53,-286.9 299,-332 301.8,-360.31 316.08,-373.26 299,-396 264.54,-441.89 216.17,-392.02 175,-432 164.61,-442.08 168.75,-449.02 165,-463"/> -<text text-anchor="middle" x="172.64" y="-192.31" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg35->Region34 --> -<g id="edge23" class="edge"> -<title>Phi_arg35->Region34</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M109.85,-178C107.39,-178 104.93,-178 102.47,-178"/> -<polygon fill="black" stroke="black" points="102.34,-174.5 92.34,-178 102.34,-181.5 102.34,-174.5"/> -<text text-anchor="middle" x="106.85" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Region39->If19 --> -<g id="edge26" class="edge"> -<title>Region39->If19:p0</title> -<path fill="none" stroke="red" d="M201.88,-195.94C181.14,-207.25 157.22,-221.86 151,-232 127.62,-270.12 139.01,-288.97 140.78,-329.99"/> -<polygon fill="red" stroke="red" points="137.28,-330.08 141,-340 144.28,-329.93 137.28,-330.08"/> -<text text-anchor="middle" x="198.88" y="-189.54" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region39->If28 --> -<g id="edge27" class="edge"> -<title>Region39->If28:p1</title> -<path fill="none" stroke="red" d="M235,-196.09C235,-205.55 235,-217.77 235,-229.69"/> -<polygon fill="red" stroke="red" points="231.5,-230 235,-240 238.5,-230 231.5,-230"/> -<text text-anchor="middle" x="232" y="-198.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return40->Region34 --> -<g id="edge28" class="edge"> -<title>Return40->Region34</title> -<path fill="none" stroke="red" d="M92.12,-124.3C87.01,-132.44 80.8,-142.31 75.16,-151.3"/> -<polygon fill="red" stroke="red" points="72.11,-149.57 69.75,-159.9 78.04,-153.29 72.11,-149.57"/> -<text text-anchor="middle" x="89.12" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return40->Phi_arg35 --> -<g id="edge29" class="edge"> -<title>Return40->Phi_arg35</title> -<path fill="none" stroke="black" d="M113.88,-124.3C119.07,-132.56 125.38,-142.61 131.1,-151.7"/> -<polygon fill="black" stroke="black" points="128.27,-153.77 136.55,-160.38 134.19,-150.05 128.27,-153.77"/> -<text text-anchor="middle" x="110.88" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="966" height="1390" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 966 1390" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(34,269)"><rect class="region-box" rx="8" width="667" height="810" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M409,1289 C409,1313 483,1316 483,1340" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #40 · CTRL</title></path><path class="edge CTRL" id="e6i1" d="M148,216 L148,339" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e6i2" d="M319,1044 L319,1054 L689,1054 L689,322 L178,322 L178,342" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[2] → #39 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M268,216 L268,226 L280,226 L280,339" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M578,200.33333333333331 L578,210.33333333333331 L662,210.33333333333331 L662,218 L679,218 L679,330 L320,330 L320,342" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #16 · DATA</title></path><path class="edge DATA" id="e10i1" d="M300,395 L300,405 L340,405 L340,443" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #8 · DATA</title></path><path class="edge DATA" id="e10i2" d="M426,216 L426,226 L370,226 L370,443" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M148,395 L148,547" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #6 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M340,499 L340,509 L228,509 L228,547" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #10 · DATA</title></path><path class="edge DATA" id="e16i1" d="M300,395 L300,405 L159,405 L159,509 L57,509 L57,1104 L24,1104 L24,84 L578,84 L578,147.33333333333331" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #8 · DATA</title></path><path class="edge DATA" id="e16i2" d="M608,74 L608,147.33333333333331" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path><path class="edge DATA" id="e18i1" d="M578,203.33333333333331 L578,246 L527,246 L527,561.6666666666666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #16 · DATA</title></path><path class="edge DATA" id="e18i2" d="M730,216 L730,226 L608,226 L608,509 L557,509 L557,561.6666666666666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #17 · DATA</title></path><path class="edge CTRL" id="e19i0" d="M128,647 L128,657 L339,657 L339,695" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[0] → #5 · CTRL</title></path><path class="edge DATA" id="e19i1" d="M527,617.6666666666666 L527,657 L419,657 L419,695" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #18 · DATA</title></path><path class="edge DATA" id="e27i1" d="M578,203.33333333333331 L578,246 L597,246 L597,709.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#27[1] → #16 · DATA</title></path><path class="edge DATA" id="e27i2" d="M882,216 L882,236 L627,236 L627,709.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#27[2] → #26 · DATA</title></path><path class="edge CTRL" id="e28i0" d="M439,795 L439,843" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#28[0] → #13 · CTRL</title></path><path class="edge DATA" id="e28i1" d="M597,765.6666666666667 L597,805 L519,805 L519,843" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#28[1] → #27 · DATA</title></path><path class="edge CTRL" id="e34i1" d="M248,647 L248,1094 L389,1094 L389,1132" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#34[1] → #7 · CTRL</title></path><path class="edge CTRL" id="e34i2" d="M419,943 L419,1132" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#34[2] → #14 · CTRL</title></path><path class="edge DATA" id="e35i1" d="M300,395 L300,405 L159,405 L159,509 L57,509 L57,1104 L521,1104 L521,1132" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[1] → #8 · DATA</title></path><path class="edge DATA" id="e35i2" d="M578,203.33333333333331 L578,246 L711,246 L711,1094 L561,1094 L561,1132" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[2] → #16 · DATA</title></path><path class="edge CTRL" id="e39i1" d="M319,795 L319,991" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#39[1] → #12 · CTRL</title></path><path class="edge CTRL" id="e39i2" d="M539,943 L539,953 L349,953 L349,991" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#39[2] → #20 · CTRL</title></path><path class="edge CTRL" id="e40i0" d="M389,1188 L389,1236" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#40[0] → #34 · CTRL</title></path><path class="edge DATA" id="e40i1" d="M541,1188 L541,1198 L429,1198 L429,1236" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#40[1] → #35 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(88,166)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(88,122)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(447,1340)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #40 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(208,166)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(68,597)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(88,345)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #39 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n7" data-id="7" transform="translate(188,597)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #7/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(240,345)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 φ_arg +Type not computed + +[0] → #6 ASSOC +[1] → #4 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #6</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(366,166)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 10 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(280,449)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(68,553)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #6 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n12" data-id="12" transform="translate(259,745)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #12/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 True +Projection 0 of #19 +Type not computed + +[0] → #19 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(379,745)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #13/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 False +Projection 1 of #19 +Type not computed + +[0] → #19 CTRL</title></g><g class="node" id="n14" data-id="14" transform="translate(359,893)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #14/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 True +Projection 0 of #28 +Type not computed + +[0] → #28 CTRL</title></g><g class="node" id="n15" data-id="15" transform="translate(548,24)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 1 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(518,153.33333333333331)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(670,166)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>5</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 5 +Type not computed + +</title></g><g class="node" id="n18" data-id="18" transform="translate(467,567.6666666666666)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 == +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #17 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n19" data-id="19" transform="translate(259,701)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#19 If +Type not computed + +[0] → #5 CTRL +[1] → #18 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n20" data-id="20" transform="translate(479,893)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #20/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 False +Projection 1 of #28 +Type not computed + +[0] → #28 CTRL</title></g><g class="node" id="n26" data-id="26" transform="translate(822,166)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>6</tspan><tspan class="node-id">  #26</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#26 6 +Type not computed + +</title></g><g class="node" id="n27" data-id="27" transform="translate(537,715.6666666666667)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #27</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#27 == +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #26 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n28" data-id="28" transform="translate(359,849)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #28</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#28 If +Type not computed + +[0] → #13 CTRL +[1] → #27 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n34" data-id="34" transform="translate(329,1138)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #34</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#34 Region +Type not computed + +[0] → — DATA +[1] → #7 CTRL +[2] → #14 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n35" data-id="35" transform="translate(481,1138)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #35</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#35 φ_arg +Type not computed + +[0] → #34 ASSOC +[1] → #8 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #34</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n39" data-id="39" transform="translate(259,997)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #39</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#39 Region +Type not computed + +[0] → — DATA +[1] → #12 CTRL +[2] → #20 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n40" data-id="40" transform="translate(349,1242)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #40</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#40 Return +Type not computed + +[0] → #34 CTRL +[1] → #35 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(34,269)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><title>Loop · 15 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #6"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter08/docs/08-graph2.json b/chapter08/docs/08-graph2.json new file mode 100644 index 00000000..6f25aaad --- /dev/null +++ b/chapter08/docs/08-graph2.json @@ -0,0 +1,39 @@ +{ + "ver": 1, + "comp": "chapter08/docs/08-graph2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 39, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 6, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 38, "role": "CTRL", "label": null}], "proj": null}, + {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 8, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 6, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": {"par": 19, "idx": 0}}, + {"id": 13, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": {"par": 19, "idx": 1}}, + {"id": 14, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 28, "role": "CTRL", "label": null}], "proj": {"par": 28, "idx": 0}}, + {"id": 15, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 18, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 17, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 28, "role": "CTRL", "label": null}], "proj": {"par": 28, "idx": 1}}, + {"id": 26, "label": "6", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 27, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 26, "role": "DATA", "label": null}], "proj": null}, + {"id": 28, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 13, "role": "CTRL", "label": null}, {"idx": 1, "def": 27, "role": "DATA", "label": null}], "proj": null}, + {"id": 34, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "CTRL", "label": null}, {"idx": 2, "def": 14, "role": "CTRL", "label": null}], "proj": null}, + {"id": 38, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 34, "role": "CTRL", "label": null}, {"idx": 2, "def": 20, "role": "CTRL", "label": null}], "proj": null}, + {"id": 39, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 6, "par": 0, "nodes": [5, 6, 7, 8, 10, 11, 16]}, + {"id": 19, "par": 6, "nodes": [12, 13, 14, 18, 19, 20, 27, 28, 34, 38]} + ] +} diff --git a/chapter08/docs/08-graph2.svg b/chapter08/docs/08-graph2.svg index 1f497470..be8bd367 100644 --- a/chapter08/docs/08-graph2.svg +++ b/chapter08/docs/08-graph2.svg @@ -1,332 +1,169 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter08 Pages: 1 --> -<svg width="334pt" height="692pt" - viewBox="0.00 0.00 334.00 692.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 688)"> -<title>chapter08</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-688 330,-688 330,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-676 318,-676 318,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="81,-639 81,-664 162,-664 162,-639 81,-639"/> -<polygon fill="none" stroke="black" points="81,-639 81,-664 162,-664 162,-639 81,-639"/> -<text text-anchor="start" x="103" y="-647.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="81,-608 81,-639 162,-639 162,-608 81,-608"/> -<polygon fill="yellow" stroke="transparent" points="86,-613 86,-634 126,-634 126,-613 86,-613"/> -<polygon fill="none" stroke="black" points="86,-613 86,-634 126,-634 126,-613 86,-613"/> -<text text-anchor="start" x="89" y="-619.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="126,-613 126,-634 157,-634 157,-613 126,-613"/> -<text text-anchor="start" x="129" y="-619.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="174,-210 120,-210 120,-174 174,-174 174,-210"/> -<text text-anchor="middle" x="147" y="-188.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return39 --> -<g id="node18" class="node"> -<title>Return39</title> -<polygon fill="yellow" stroke="black" points="228,-310 162,-310 162,-274 228,-274 228,-310"/> -<text text-anchor="middle" x="195" y="-288.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return39 --> -<g id="edge1" class="edge"> -<title>Stop3->Return39</title> -<path fill="none" stroke="red" d="M155.36,-210.07C162.75,-225.15 173.64,-247.39 182.14,-264.74"/> -<polygon fill="red" stroke="red" points="179.03,-266.36 186.57,-273.8 185.32,-263.28 179.03,-266.36"/> -<text text-anchor="middle" x="152.36" y="-212.67" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Loop6 --> -<g id="node3" class="node"> -<title>Loop6</title> -<polygon fill="yellow" stroke="black" points="72,-568 18,-568 18,-532 72,-532 72,-568"/> -<text text-anchor="middle" x="45" y="-546.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop6->Start2 --> -<g id="edge2" class="edge"> -<title>Loop6->Start2:p0</title> -<path fill="none" stroke="red" d="M46.96,-568.06C49.95,-586.19 57.29,-613.28 74.85,-620.93"/> -<polygon fill="red" stroke="red" points="74.5,-624.43 85,-623 75.9,-617.57 74.5,-624.43"/> -<text text-anchor="middle" x="43.96" y="-570.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region38 --> -<g id="node17" class="node"> -<title>Region38</title> -<polygon fill="yellow" stroke="black" points="274,-52 208,-52 208,-16 274,-16 274,-52"/> -<text text-anchor="middle" x="241" y="-30.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Loop6->Region38 --> -<g id="edge3" class="edge"> -<title>Loop6->Region38</title> -<path fill="none" stroke="red" d="M38.06,-531.98C28.81,-508.26 12.9,-463.71 7,-424 -3.78,-351.47 4.18,-330.31 25,-260 38.69,-213.78 36.96,-197.7 67,-160 103.26,-114.48 160.19,-77.91 198.98,-56.36"/> -<polygon fill="red" stroke="red" points="200.84,-59.33 207.94,-51.46 197.49,-53.18 200.84,-59.33"/> -<text text-anchor="middle" x="35.06" y="-525.58" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg8 --> -<g id="node4" class="node"> -<title>Phi_arg8</title> -<ellipse fill="lightyellow" stroke="black" cx="199" cy="-550" rx="37.09" ry="18"/> -<text text-anchor="middle" x="199" y="-546.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg8->Start2 --> -<g id="edge5" class="edge"> -<title>Phi_arg8->Start2:p1</title> -<path fill="none" stroke="black" d="M196.84,-568.06C193.65,-586.19 185.98,-613.28 168.23,-620.93"/> -<polygon fill="black" stroke="black" points="167.11,-617.58 158,-623 168.5,-624.44 167.11,-617.58"/> -<text text-anchor="middle" x="193.84" y="-570.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg8->Loop6 --> -<g id="edge4" class="edge"> -<title>Phi_arg8->Loop6</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M180.53,-534.01C170.46,-526.34 157.34,-517.98 144,-514 121,-507.14 112.65,-506.06 90,-514 82.86,-516.5 76.01,-520.67 69.91,-525.3"/> -<polygon fill="black" stroke="black" points="67.55,-522.71 62.08,-531.78 72.01,-528.1 67.55,-522.71"/> -<text text-anchor="middle" x="177.53" y="-527.61" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add16 --> -<g id="node9" class="node"> -<title>Add16</title> -<ellipse fill="none" stroke="black" cx="271" cy="-478" rx="27" ry="18"/> -<text text-anchor="middle" x="271" y="-474.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Con_9 --> -<g id="node5" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="117" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="117" y="-546.3" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT10 --> -<g id="node6" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="99" cy="-478" rx="27" ry="18"/> -<text text-anchor="middle" x="99" y="-474.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg8 --> -<g id="edge7" class="edge"> -<title>LT10->Phi_arg8</title> -<path fill="none" stroke="black" d="M116.88,-491.51C131.61,-501.83 152.8,-516.66 169.97,-528.68"/> -<polygon fill="black" stroke="black" points="168.32,-531.8 178.52,-534.66 172.33,-526.06 168.32,-531.8"/> -<text text-anchor="middle" x="113.88" y="-494.11" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT10->Con_9 --> -<g id="edge8" class="edge"> -<title>LT10->Con_9</title> -<path fill="none" stroke="black" d="M103.36,-495.95C105.39,-503.86 107.86,-513.46 110.14,-522.31"/> -<polygon fill="black" stroke="black" points="106.8,-523.4 112.68,-532.21 113.58,-521.65 106.8,-523.4"/> -<text text-anchor="middle" x="100.36" y="-498.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11 --> -<g id="node7" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="24,-395 24,-420 118,-420 118,-395 24,-395"/> -<polygon fill="none" stroke="black" points="24,-395 24,-420 118,-420 118,-395 24,-395"/> -<text text-anchor="start" x="65.5" y="-403.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="24,-364 24,-395 118,-395 118,-364 24,-364"/> -<polygon fill="yellow" stroke="transparent" points="29,-369 29,-390 69,-390 69,-369 29,-369"/> -<polygon fill="none" stroke="black" points="29,-369 29,-390 69,-390 69,-369 29,-369"/> -<text text-anchor="start" x="32" y="-375.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="69,-369 69,-390 113,-390 113,-369 69,-369"/> -<polygon fill="none" stroke="black" points="69,-369 69,-390 113,-390 113,-369 69,-369"/> -<text text-anchor="start" x="72" y="-375.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If11->Loop6 --> -<g id="edge9" class="edge"> -<title>If11->Loop6</title> -<path fill="none" stroke="red" d="M65.8,-424.19C61.04,-452.77 54.06,-494.64 49.52,-521.86"/> -<polygon fill="red" stroke="red" points="46.05,-521.42 47.86,-531.86 52.95,-522.57 46.05,-521.42"/> -<text text-anchor="middle" x="62.8" y="-426.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT10 --> -<g id="edge10" class="edge"> -<title>If11->LT10</title> -<path fill="none" stroke="black" d="M81.43,-424.28C84.3,-432.9 87.39,-442.17 90.16,-450.49"/> -<polygon fill="black" stroke="black" points="86.87,-451.69 93.36,-460.07 93.51,-449.48 86.87,-451.69"/> -<text text-anchor="middle" x="78.43" y="-426.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node8" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="281" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="281" y="-546.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add16->Phi_arg8 --> -<g id="edge11" class="edge"> -<title>Add16->Phi_arg8</title> -<path fill="none" stroke="black" d="M249.16,-500.23C240.6,-508.56 230.75,-518.13 222.07,-526.57"/> -<polygon fill="black" stroke="black" points="251.7,-502.65 256.43,-493.17 246.82,-497.63 251.7,-502.65"/> -<polygon fill="black" stroke="black" points="219.53,-524.16 214.8,-533.64 224.41,-529.18 219.53,-524.16"/> -<text text-anchor="middle" x="253.43" y="-495.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16->Con_15 --> -<g id="edge12" class="edge"> -<title>Add16->Con_15</title> -<path fill="none" stroke="black" d="M273.42,-495.95C274.52,-503.65 275.85,-512.97 277.09,-521.64"/> -<polygon fill="black" stroke="black" points="273.65,-522.32 278.53,-531.72 280.58,-521.33 273.65,-522.32"/> -<text text-anchor="middle" x="270.42" y="-498.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_17 --> -<g id="node10" class="node"> -<title>Con_17</title> -<ellipse fill="none" stroke="black" cx="171" cy="-478" rx="27" ry="18"/> -<text text-anchor="middle" x="171" y="-474.3" font-family="Times,serif" font-size="14.00">5</text> -</g> -<!-- EQ18 --> -<g id="node11" class="node"> -<title>EQ18</title> -<ellipse fill="none" stroke="black" cx="171" cy="-392" rx="27" ry="18"/> -<text text-anchor="middle" x="171" y="-388.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ18->Add16 --> -<g id="edge13" class="edge"> -<title>EQ18->Add16</title> -<path fill="none" stroke="black" d="M187.07,-406.5C203.23,-420.07 228.34,-441.16 246.89,-456.75"/> -<polygon fill="black" stroke="black" points="244.73,-459.51 254.64,-463.26 249.24,-454.15 244.73,-459.51"/> -<text text-anchor="middle" x="184.07" y="-409.1" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ18->Con_17 --> -<g id="edge14" class="edge"> -<title>EQ18->Con_17</title> -<path fill="none" stroke="black" d="M171,-410.4C171,-421.74 171,-436.77 171,-449.68"/> -<polygon fill="black" stroke="black" points="167.5,-449.9 171,-459.9 174.5,-449.9 167.5,-449.9"/> -<text text-anchor="middle" x="168" y="-413" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If19 --> -<g id="node12" class="node"> -<title>If19</title> -<polygon fill="yellow" stroke="transparent" points="42,-295 42,-320 136,-320 136,-295 42,-295"/> -<polygon fill="none" stroke="black" points="42,-295 42,-320 136,-320 136,-295 42,-295"/> -<text text-anchor="start" x="83.5" y="-303.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="42,-264 42,-295 136,-295 136,-264 42,-264"/> -<polygon fill="yellow" stroke="transparent" points="47,-269 47,-290 87,-290 87,-269 47,-269"/> -<polygon fill="none" stroke="black" points="47,-269 47,-290 87,-290 87,-269 47,-269"/> -<text text-anchor="start" x="50" y="-275.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="87,-269 87,-290 131,-290 131,-269 87,-269"/> -<polygon fill="none" stroke="black" points="87,-269 87,-290 131,-290 131,-269 87,-269"/> -<text text-anchor="start" x="90" y="-275.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If19->If11 --> -<g id="edge15" class="edge"> -<title>If19->If11:p0</title> -<path fill="none" stroke="red" d="M63.67,-324.33C57.47,-334.31 52,-345.89 49.91,-357.87"/> -<polygon fill="red" stroke="red" points="46.41,-357.73 49,-368 53.38,-358.35 46.41,-357.73"/> -<text text-anchor="middle" x="60.67" y="-326.93" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If19->EQ18 --> -<g id="edge16" class="edge"> -<title>If19->EQ18</title> -<path fill="none" stroke="black" d="M114.95,-324.01C126.8,-338.18 140.6,-354.67 151.55,-367.75"/> -<polygon fill="black" stroke="black" points="149.18,-370.37 158.28,-375.8 154.54,-365.88 149.18,-370.37"/> -<text text-anchor="middle" x="111.95" y="-326.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_26 --> -<g id="node13" class="node"> -<title>Con_26</title> -<ellipse fill="none" stroke="black" cx="263" cy="-392" rx="27" ry="18"/> -<text text-anchor="middle" x="263" y="-388.3" font-family="Times,serif" font-size="14.00">6</text> -</g> -<!-- EQ27 --> -<g id="node14" class="node"> -<title>EQ27</title> -<ellipse fill="none" stroke="black" cx="273" cy="-292" rx="27" ry="18"/> -<text text-anchor="middle" x="273" y="-288.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ27->Add16 --> -<g id="edge17" class="edge"> -<title>EQ27->Add16</title> -<path fill="none" stroke="black" d="M281.29,-309.29C287.55,-322.56 295.62,-341.97 299,-360 304.23,-387.96 305.84,-396.39 299,-424 296.57,-433.79 291.97,-443.77 287.18,-452.38"/> -<polygon fill="black" stroke="black" points="284.09,-450.74 282.02,-461.13 290.12,-454.3 284.09,-450.74"/> -<text text-anchor="middle" x="278.29" y="-311.89" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ27->Con_26 --> -<g id="edge18" class="edge"> -<title>EQ27->Con_26</title> -<path fill="none" stroke="black" d="M271.26,-310.07C269.75,-324.88 267.53,-346.57 265.78,-363.77"/> -<polygon fill="black" stroke="black" points="262.29,-363.49 264.76,-373.8 269.25,-364.2 262.29,-363.49"/> -<text text-anchor="middle" x="268.26" y="-312.67" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If28 --> -<g id="node15" class="node"> -<title>If28</title> -<polygon fill="yellow" stroke="transparent" points="200,-195 200,-220 294,-220 294,-195 200,-195"/> -<polygon fill="none" stroke="black" points="200,-195 200,-220 294,-220 294,-195 200,-195"/> -<text text-anchor="start" x="241.5" y="-203.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="200,-164 200,-195 294,-195 294,-164 200,-164"/> -<polygon fill="yellow" stroke="transparent" points="205,-169 205,-190 245,-190 245,-169 205,-169"/> -<polygon fill="none" stroke="black" points="205,-169 205,-190 245,-190 245,-169 205,-169"/> -<text text-anchor="start" x="208" y="-175.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="245,-169 245,-190 289,-190 289,-169 245,-169"/> -<polygon fill="none" stroke="black" points="245,-169 245,-190 289,-190 289,-169 245,-169"/> -<text text-anchor="start" x="248" y="-175.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If28->If19 --> -<g id="edge19" class="edge"> -<title>If28->If19:p1</title> -<path fill="none" stroke="red" d="M200.79,-224.33C185.31,-235.25 168.15,-247.82 153,-260 146.72,-265.05 145.03,-271.43 141.32,-275.36"/> -<polygon fill="red" stroke="red" points="140.04,-272.1 132,-279 142.59,-278.62 140.04,-272.1"/> -<text text-anchor="middle" x="197.79" y="-226.93" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If28->EQ27 --> -<g id="edge20" class="edge"> -<title>If28->EQ27</title> -<path fill="none" stroke="black" d="M255.23,-224.01C258.67,-236.98 262.63,-251.9 265.93,-264.36"/> -<polygon fill="black" stroke="black" points="262.58,-265.39 268.53,-274.15 269.35,-263.59 262.58,-265.39"/> -<text text-anchor="middle" x="252.23" y="-226.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region34 --> -<g id="node16" class="node"> -<title>Region34</title> -<polygon fill="yellow" stroke="black" points="248,-124 182,-124 182,-88 248,-88 248,-124"/> -<text text-anchor="middle" x="215" y="-102.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region34->If19 --> -<g id="edge21" class="edge"> -<title>Region34->If19:p0</title> -<path fill="none" stroke="red" d="M181.63,-117.1C159.08,-125.42 130.06,-139.26 111,-160 78.33,-195.56 68.34,-213.61 67.13,-257.83"/> -<polygon fill="red" stroke="red" points="63.63,-257.96 67,-268 70.63,-258.05 63.63,-257.96"/> -<text text-anchor="middle" x="178.63" y="-110.7" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region34->If28 --> -<g id="edge22" class="edge"> -<title>Region34->If28:p0</title> -<path fill="none" stroke="red" d="M219.36,-124.23C221.44,-133.63 223.68,-145.75 224.58,-157.66"/> -<polygon fill="red" stroke="red" points="221.1,-158.15 225,-168 228.09,-157.87 221.1,-158.15"/> -<text text-anchor="middle" x="216.36" y="-126.83" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region38->If28 --> -<g id="edge24" class="edge"> -<title>Region38->If28:p1</title> -<path fill="none" stroke="red" d="M247.09,-52.47C250.45,-62.71 254.45,-75.96 257,-88 263.67,-119.49 266.43,-130.05 266.92,-157.85"/> -<polygon fill="red" stroke="red" points="263.42,-158.03 267,-168 270.42,-157.97 263.42,-158.03"/> -<text text-anchor="middle" x="244.09" y="-55.07" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Region38->Region34 --> -<g id="edge23" class="edge"> -<title>Region38->Region34</title> -<path fill="none" stroke="red" d="M234.57,-52.3C231.64,-60.19 228.11,-69.7 224.86,-78.45"/> -<polygon fill="red" stroke="red" points="221.55,-77.3 221.35,-87.9 228.12,-79.74 221.55,-77.3"/> -<text text-anchor="middle" x="231.57" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return39->Phi_arg8 --> -<g id="edge26" class="edge"> -<title>Return39->Phi_arg8</title> -<path fill="none" stroke="black" d="M198.96,-310.24C201.84,-323.7 205.48,-342.93 207,-360 212.35,-420.21 211.52,-435.73 207,-496 206.36,-504.48 205.16,-513.66 203.88,-521.96"/> -<polygon fill="black" stroke="black" points="200.42,-521.45 202.25,-531.89 207.32,-522.59 200.42,-521.45"/> -<text text-anchor="middle" x="195.96" y="-312.84" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return39->If11 --> -<g id="edge25" class="edge"> -<title>Return39->If11:p1</title> -<path fill="none" stroke="red" d="M179.78,-310.4C162.83,-329.64 136.01,-359.63 122.28,-372.63"/> -<polygon fill="red" stroke="red" points="119.79,-370.13 114,-379 124.06,-375.68 119.79,-370.13"/> -<text text-anchor="middle" x="176.78" y="-313" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="902" height="1452" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 902 1452" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(133,171)"><rect class="region-box" rx="8" width="691" height="1074" fill="#f1f6fc"/></g><g class="region" transform="translate(347,602)"><rect class="region-box" rx="8" width="422" height="606" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M356,1351 C356,1375 451,1378 451,1402" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #39 · CTRL</title></path><path class="edge CTRL" id="e6i1" d="M236,118 L236,241" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e6i2" d="M580,1193 L580,1203 L812,1203 L812,224 L266,224 L266,244" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[2] → #38 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M356,118 L356,128 L368,128 L368,241" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M519,398 L519,408 L802,408 L802,232 L408,232 L408,244" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #16 · DATA</title></path><path class="edge DATA" id="e10i1" d="M388,297 L388,307 L316,307 L316,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #8 · DATA</title></path><path class="edge DATA" id="e10i2" d="M84,118 L84,128 L165,128 L165,317 L346,317 L346,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M236,297 L236,449" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #6 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M316,401 L316,449" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #10 · DATA</title></path><path class="edge DATA" id="e16i1" d="M388,297 L388,307 L519,307 L519,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #8 · DATA</title></path><path class="edge DATA" id="e16i2" d="M514,118 L514,128 L549,128 L549,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path><path class="edge DATA" id="e18i1" d="M519,401 L519,636" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #16 · DATA</title></path><path class="edge DATA" id="e18i2" d="M666,118 L666,128 L599,128 L599,421 L549,421 L549,636" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #17 · DATA</title></path><path class="edge CTRL" id="e19i0" d="M216,549 L216,559 L439,559 L439,740" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[0] → #5 · CTRL</title></path><path class="edge DATA" id="e19i1" d="M519,692 L519,740" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #18 · DATA</title></path><path class="edge DATA" id="e27i1" d="M519,401 L519,411 L697,411 L697,754.6666666666666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#27[1] → #16 · DATA</title></path><path class="edge DATA" id="e27i2" d="M818,118 L818,128 L727,128 L727,754.6666666666666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#27[2] → #26 · DATA</title></path><path class="edge CTRL" id="e28i0" d="M539,840 L539,850 L510,850 L510,888" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#28[0] → #13 · CTRL</title></path><path class="edge DATA" id="e28i1" d="M697,810.6666666666666 L697,850 L590,850 L590,888" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#28[1] → #27 · DATA</title></path><path class="edge CTRL" id="e34i1" d="M419,840 L419,998 L460,998 L460,1036" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#34[1] → #12 · CTRL</title></path><path class="edge CTRL" id="e34i2" d="M490,988 L490,1036" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#34[2] → #14 · CTRL</title></path><path class="edge CTRL" id="e38i1" d="M460,1092 L460,1102 L580,1102 L580,1140" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#38[1] → #34 · CTRL</title></path><path class="edge CTRL" id="e38i2" d="M610,988 L610,1140" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#38[2] → #20 · CTRL</title></path><path class="edge CTRL" id="e39i0" d="M336,549 L336,1298" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#39[0] → #7 · CTRL</title></path><path class="edge DATA" id="e39i1" d="M388,297 L388,307 L779,307 L779,1260 L376,1260 L376,1298" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#39[1] → #8 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(415,1402)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #39 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(156,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(176,247)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #38 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n7" data-id="7" transform="translate(276,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #7/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(328,247)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 φ_arg +Type not computed + +[0] → #6 ASSOC +[1] → #4 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #6</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 10 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(256,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(156,455)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #6 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n12" data-id="12" transform="translate(359,790)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #12/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 True +Projection 0 of #19 +Type not computed + +[0] → #19 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(479,790)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #13/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 False +Projection 1 of #19 +Type not computed + +[0] → #19 CTRL</title></g><g class="node" id="n14" data-id="14" transform="translate(430,938)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #14/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 True +Projection 0 of #28 +Type not computed + +[0] → #28 CTRL</title></g><g class="node" id="n15" data-id="15" transform="translate(454,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 1 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(459,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(606,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>5</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 5 +Type not computed + +</title></g><g class="node" id="n18" data-id="18" transform="translate(459,642)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 == +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #17 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n19" data-id="19" transform="translate(359,746)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#19 If +Type not computed + +[0] → #5 CTRL +[1] → #18 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n20" data-id="20" transform="translate(550,938)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #20/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 False +Projection 1 of #28 +Type not computed + +[0] → #28 CTRL</title></g><g class="node" id="n26" data-id="26" transform="translate(758,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>6</tspan><tspan class="node-id">  #26</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#26 6 +Type not computed + +</title></g><g class="node" id="n27" data-id="27" transform="translate(637,760.6666666666666)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #27</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#27 == +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #26 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n28" data-id="28" transform="translate(430,894)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #28</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#28 If +Type not computed + +[0] → #13 CTRL +[1] → #27 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n34" data-id="34" transform="translate(400,1042)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #34</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#34 Region +Type not computed + +[0] → — DATA +[1] → #12 CTRL +[2] → #14 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n38" data-id="38" transform="translate(520,1146)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #38</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#38 Region +Type not computed + +[0] → — DATA +[1] → #34 CTRL +[2] → #20 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n39" data-id="39" transform="translate(296,1304)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #39</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#39 Return +Type not computed + +[0] → #7 CTRL +[1] → #8 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(133,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><title>Loop · 17 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #6"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(347,602)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #19</tspan></text><title>If · 10 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #19"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter08/docs/08-graph3.json b/chapter08/docs/08-graph3.json new file mode 100644 index 00000000..a795c51d --- /dev/null +++ b/chapter08/docs/08-graph3.json @@ -0,0 +1,40 @@ +{ + "ver": 1, + "comp": "chapter08/docs/08-graph3.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 39, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 6, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 20, "role": "CTRL", "label": null}], "proj": null}, + {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 8, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 6, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": {"par": 19, "idx": 0}}, + {"id": 13, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": {"par": 19, "idx": 1}}, + {"id": 14, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 30, "role": "CTRL", "label": null}], "proj": {"par": 30, "idx": 0}}, + {"id": 15, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 18, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 17, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 30, "role": "CTRL", "label": null}], "proj": {"par": 30, "idx": 1}}, + {"id": 25, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 7, "role": "CTRL", "label": null}, {"idx": 2, "def": 12, "role": "CTRL", "label": null}], "proj": null}, + {"id": 26, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 25, "role": "ASSOC", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 28, "label": "6", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 29, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 28, "role": "DATA", "label": null}], "proj": null}, + {"id": 30, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 13, "role": "CTRL", "label": null}, {"idx": 1, "def": 29, "role": "DATA", "label": null}], "proj": null}, + {"id": 36, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 25, "role": "CTRL", "label": null}, {"idx": 2, "def": 14, "role": "CTRL", "label": null}], "proj": null}, + {"id": 37, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 36, "role": "ASSOC", "label": null}, {"idx": 1, "def": 26, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 39, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 36, "role": "CTRL", "label": null}, {"idx": 1, "def": 37, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 6, "par": 0, "nodes": [5, 6, 7, 8, 10, 11, 12, 13, 14, 18, 19, 20, 29, 30]} + ] +} diff --git a/chapter08/docs/08-graph3.svg b/chapter08/docs/08-graph3.svg index 12aafcc5..d2c78bc5 100644 --- a/chapter08/docs/08-graph3.svg +++ b/chapter08/docs/08-graph3.svg @@ -1,386 +1,179 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter08 Pages: 1 --> -<svg width="396pt" height="764pt" - viewBox="0.00 0.00 395.85 764.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 760)"> -<title>chapter08</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-760 391.85,-760 391.85,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-748 378,-748 378,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="44,-711 44,-736 125,-736 125,-711 44,-711"/> -<polygon fill="none" stroke="black" points="44,-711 44,-736 125,-736 125,-711 44,-711"/> -<text text-anchor="start" x="66" y="-719.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="44,-680 44,-711 125,-711 125,-680 44,-680"/> -<polygon fill="yellow" stroke="transparent" points="49,-685 49,-706 89,-706 89,-685 49,-685"/> -<polygon fill="none" stroke="black" points="49,-685 49,-706 89,-706 89,-685 49,-685"/> -<text text-anchor="start" x="52" y="-691.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="89,-685 89,-706 120,-706 120,-685 89,-685"/> -<text text-anchor="start" x="92" y="-691.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="144,-52 90,-52 90,-16 144,-16 144,-52"/> -<text text-anchor="middle" x="117" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return39 --> -<g id="node20" class="node"> -<title>Return39</title> -<polygon fill="yellow" stroke="black" points="150,-124 84,-124 84,-88 150,-88 150,-124"/> -<text text-anchor="middle" x="117" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return39 --> -<g id="edge1" class="edge"> -<title>Stop3->Return39</title> -<path fill="none" stroke="red" d="M117,-52.3C117,-60.02 117,-69.29 117,-77.89"/> -<polygon fill="red" stroke="red" points="113.5,-77.9 117,-87.9 120.5,-77.9 113.5,-77.9"/> -<text text-anchor="middle" x="114" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Loop6 --> -<g id="node3" class="node"> -<title>Loop6</title> -<polygon fill="yellow" stroke="black" points="70,-640 16,-640 16,-604 70,-604 70,-640"/> -<text text-anchor="middle" x="43" y="-618.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop6->Start2 --> -<g id="edge2" class="edge"> -<title>Loop6->Start2:p0</title> -<path fill="none" stroke="red" d="M54.63,-640.06C60.09,-649.38 65.88,-661.53 68.08,-673.99"/> -<polygon fill="red" stroke="red" points="64.6,-674.36 69,-684 71.57,-673.72 64.6,-674.36"/> -<text text-anchor="middle" x="51.63" y="-642.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If30 --> -<g id="node17" class="node"> -<title>If30</title> -<polygon fill="yellow" stroke="transparent" points="220,-267 220,-292 314,-292 314,-267 220,-267"/> -<polygon fill="none" stroke="black" points="220,-267 220,-292 314,-292 314,-267 220,-267"/> -<text text-anchor="start" x="261.5" y="-275.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="220,-236 220,-267 314,-267 314,-236 220,-236"/> -<polygon fill="yellow" stroke="transparent" points="225,-241 225,-262 265,-262 265,-241 225,-241"/> -<polygon fill="none" stroke="black" points="225,-241 225,-262 265,-262 265,-241 225,-241"/> -<text text-anchor="start" x="228" y="-247.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="265,-241 265,-262 309,-262 309,-241 265,-241"/> -<polygon fill="none" stroke="black" points="265,-241 265,-262 309,-262 309,-241 265,-241"/> -<text text-anchor="start" x="268" y="-247.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- Loop6->If30 --> -<g id="edge3" class="edge"> -<title>Loop6->If30:p1</title> -<path fill="none" stroke="red" d="M70.26,-607.38C73.18,-606.15 76.13,-604.99 79,-604 147.07,-580.48 188.31,-621.07 237,-568 257.49,-545.67 264.72,-456.58 247,-432 217.42,-390.95 168.58,-437.05 139,-396 122.37,-372.92 120.93,-353.97 139,-332 191.65,-267.98 269.35,-360.02 322,-296 337.53,-277.12 339.04,-258.53 322,-241 314.29,-233.07 299.85,-228.04 292.15,-231.39"/> -<polygon fill="red" stroke="red" points="289.13,-229.62 287,-240 295.14,-233.22 289.13,-229.62"/> -<text text-anchor="middle" x="73.26" y="-600.98" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg8 --> -<g id="node4" class="node"> -<title>Phi_arg8</title> -<ellipse fill="lightyellow" stroke="black" cx="125" cy="-622" rx="37.09" ry="18"/> -<text text-anchor="middle" x="125" y="-618.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg8->Start2 --> -<g id="edge5" class="edge"> -<title>Phi_arg8->Start2:p1</title> -<path fill="none" stroke="black" d="M116.4,-639.61C112.12,-649.08 107.5,-661.53 105.74,-674.02"/> -<polygon fill="black" stroke="black" points="102.25,-673.77 105,-684 109.23,-674.29 102.25,-673.77"/> -<text text-anchor="middle" x="113.4" y="-642.21" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg8->Loop6 --> -<g id="edge4" class="edge"> -<title>Phi_arg8->Loop6</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M87.77,-622C85.3,-622 82.84,-622 80.37,-622"/> -<polygon fill="black" stroke="black" points="80.23,-618.5 70.23,-622 80.23,-625.5 80.23,-618.5"/> -<text text-anchor="middle" x="84.77" y="-615.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add16 --> -<g id="node9" class="node"> -<title>Add16</title> -<ellipse fill="none" stroke="black" cx="293" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="293" y="-546.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Con_9 --> -<g id="node5" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="207" cy="-622" rx="27" ry="18"/> -<text text-anchor="middle" x="207" y="-618.3" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT10 --> -<g id="node6" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="125" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="125" y="-546.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg8 --> -<g id="edge7" class="edge"> -<title>LT10->Phi_arg8</title> -<path fill="none" stroke="black" d="M125,-568.3C125,-576.02 125,-585.29 125,-593.89"/> -<polygon fill="black" stroke="black" points="121.5,-593.9 125,-603.9 128.5,-593.9 121.5,-593.9"/> -<text text-anchor="middle" x="122" y="-570.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT10->Con_9 --> -<g id="edge8" class="edge"> -<title>LT10->Con_9</title> -<path fill="none" stroke="black" d="M141.2,-564.83C153.18,-575.06 169.69,-589.15 183.18,-600.66"/> -<polygon fill="black" stroke="black" points="181.23,-603.61 191.11,-607.44 185.78,-598.28 181.23,-603.61"/> -<text text-anchor="middle" x="138.2" y="-567.43" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11 --> -<g id="node7" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="44,-467 44,-492 138,-492 138,-467 44,-467"/> -<polygon fill="none" stroke="black" points="44,-467 44,-492 138,-492 138,-467 44,-467"/> -<text text-anchor="start" x="85.5" y="-475.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="44,-436 44,-467 138,-467 138,-436 44,-436"/> -<polygon fill="yellow" stroke="transparent" points="49,-441 49,-462 89,-462 89,-441 49,-441"/> -<polygon fill="none" stroke="black" points="49,-441 49,-462 89,-462 89,-441 49,-441"/> -<text text-anchor="start" x="52" y="-447.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="89,-441 89,-462 133,-462 133,-441 89,-441"/> -<polygon fill="none" stroke="black" points="89,-441 89,-462 133,-462 133,-441 89,-441"/> -<text text-anchor="start" x="92" y="-447.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If11->Loop6 --> -<g id="edge9" class="edge"> -<title>If11->Loop6</title> -<path fill="none" stroke="red" d="M81.4,-496.19C72.57,-524.89 59.61,-567.01 51.24,-594.22"/> -<polygon fill="red" stroke="red" points="47.87,-593.27 48.27,-603.86 54.56,-595.33 47.87,-593.27"/> -<text text-anchor="middle" x="78.4" y="-498.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT10 --> -<g id="edge10" class="edge"> -<title>If11->LT10</title> -<path fill="none" stroke="black" d="M103.66,-496.28C107.24,-505.13 111.1,-514.66 114.54,-523.15"/> -<polygon fill="black" stroke="black" points="111.34,-524.59 118.34,-532.54 117.83,-521.96 111.34,-524.59"/> -<text text-anchor="middle" x="100.66" y="-498.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_15 --> -<g id="node8" class="node"> -<title>Con_15</title> -<ellipse fill="none" stroke="black" cx="293" cy="-622" rx="27" ry="18"/> -<text text-anchor="middle" x="293" y="-618.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add16->Phi_arg8 --> -<g id="edge11" class="edge"> -<title>Add16->Phi_arg8</title> -<path fill="none" stroke="black" d="M261.07,-564.31C232.75,-576.1 191.39,-593.34 161.72,-605.7"/> -<polygon fill="black" stroke="black" points="262.81,-567.37 270.69,-560.3 260.11,-560.91 262.81,-567.37"/> -<polygon fill="black" stroke="black" points="160.02,-602.62 152.13,-609.69 162.71,-609.08 160.02,-602.62"/> -<text text-anchor="middle" x="267.69" y="-562.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16->Con_15 --> -<g id="edge12" class="edge"> -<title>Add16->Con_15</title> -<path fill="none" stroke="black" d="M293,-568.3C293,-576.02 293,-585.29 293,-593.89"/> -<polygon fill="black" stroke="black" points="289.5,-593.9 293,-603.9 296.5,-593.9 289.5,-593.9"/> -<text text-anchor="middle" x="290" y="-570.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_17 --> -<g id="node10" class="node"> -<title>Con_17</title> -<ellipse fill="none" stroke="black" cx="201" cy="-550" rx="27" ry="18"/> -<text text-anchor="middle" x="201" y="-546.3" font-family="Times,serif" font-size="14.00">5</text> -</g> -<!-- EQ18 --> -<g id="node11" class="node"> -<title>EQ18</title> -<ellipse fill="none" stroke="black" cx="211" cy="-464" rx="27" ry="18"/> -<text text-anchor="middle" x="211" y="-460.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ18->Add16 --> -<g id="edge13" class="edge"> -<title>EQ18->Add16</title> -<path fill="none" stroke="black" d="M225.28,-479.63C238.1,-492.76 257.09,-512.21 271.7,-527.18"/> -<polygon fill="black" stroke="black" points="269.39,-529.83 278.88,-534.54 274.4,-524.94 269.39,-529.83"/> -<text text-anchor="middle" x="222.28" y="-482.23" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ18->Con_17 --> -<g id="edge14" class="edge"> -<title>EQ18->Con_17</title> -<path fill="none" stroke="black" d="M208.98,-482C207.61,-493.5 205.77,-508.93 204.2,-522.08"/> -<polygon fill="black" stroke="black" points="200.73,-521.68 203.02,-532.03 207.68,-522.51 200.73,-521.68"/> -<text text-anchor="middle" x="205.98" y="-484.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If19 --> -<g id="node12" class="node"> -<title>If19</title> -<polygon fill="yellow" stroke="transparent" points="156,-367 156,-392 250,-392 250,-367 156,-367"/> -<polygon fill="none" stroke="black" points="156,-367 156,-392 250,-392 250,-367 156,-367"/> -<text text-anchor="start" x="197.5" y="-375.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="156,-336 156,-367 250,-367 250,-336 156,-336"/> -<polygon fill="yellow" stroke="transparent" points="161,-341 161,-362 201,-362 201,-341 161,-341"/> -<polygon fill="none" stroke="black" points="161,-341 161,-362 201,-362 201,-341 161,-341"/> -<text text-anchor="start" x="164" y="-347.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="201,-341 201,-362 245,-362 245,-341 201,-341"/> -<polygon fill="none" stroke="black" points="201,-341 201,-362 245,-362 245,-341 201,-341"/> -<text text-anchor="start" x="204" y="-347.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If19->If11 --> -<g id="edge15" class="edge"> -<title>If19->If11:p0</title> -<path fill="none" stroke="red" d="M147.72,-384.8C116.87,-397.31 82.59,-414.16 72.17,-430.48"/> -<polygon fill="red" stroke="red" points="68.84,-429.41 69,-440 75.48,-431.62 68.84,-429.41"/> -<text text-anchor="middle" x="144.72" y="-378.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If19->EQ18 --> -<g id="edge16" class="edge"> -<title>If19->EQ18</title> -<path fill="none" stroke="black" d="M205.53,-396.01C206.57,-408.76 207.77,-423.4 208.77,-435.73"/> -<polygon fill="black" stroke="black" points="205.3,-436.19 209.6,-445.87 212.28,-435.62 205.3,-436.19"/> -<text text-anchor="middle" x="202.53" y="-398.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region25 --> -<g id="node13" class="node"> -<title>Region25</title> -<polygon fill="yellow" stroke="black" points="194,-282 128,-282 128,-246 194,-246 194,-282"/> -<text text-anchor="middle" x="161" y="-260.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region25->If11 --> -<g id="edge17" class="edge"> -<title>Region25->If11:p1</title> -<path fill="none" stroke="red" d="M149.15,-282.07C140.7,-295.13 129.84,-313.92 124,-332 110.25,-374.59 110.82,-389.45 110.98,-429.78"/> -<polygon fill="red" stroke="red" points="107.48,-430.01 111,-440 114.48,-429.99 107.48,-430.01"/> -<text text-anchor="middle" x="146.15" y="-284.67" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region25->If19 --> -<g id="edge18" class="edge"> -<title>Region25->If19:p0</title> -<path fill="none" stroke="red" d="M168.33,-282.23C173.11,-294.76 178.75,-312.49 180.47,-329.86"/> -<polygon fill="red" stroke="red" points="176.99,-330.19 181,-340 183.98,-329.83 176.99,-330.19"/> -<text text-anchor="middle" x="165.33" y="-284.83" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg26 --> -<g id="node14" class="node"> -<title>Phi_arg26</title> -<ellipse fill="lightyellow" stroke="black" cx="73" cy="-264" rx="37.09" ry="18"/> -<text text-anchor="middle" x="73" y="-260.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg26->Phi_arg8 --> -<g id="edge20" class="edge"> -<title>Phi_arg26->Phi_arg8</title> -<path fill="none" stroke="black" d="M63.83,-281.65C43.83,-320.21 0.18,-418.31 27,-496 41.37,-537.63 75.96,-575.97 99.94,-598.92"/> -<polygon fill="black" stroke="black" points="97.62,-601.54 107.31,-605.82 102.4,-596.43 97.62,-601.54"/> -<text text-anchor="middle" x="60.83" y="-284.25" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg26->Add16 --> -<g id="edge21" class="edge"> -<title>Phi_arg26->Add16</title> -<path fill="none" stroke="black" d="M91.19,-280C99.25,-285.9 109.13,-292.16 119,-296 169.26,-315.55 323.81,-291.14 359,-332 470,-460.89 226.92,-368.94 175,-432 156.92,-453.96 159.55,-472.12 175,-496 184.72,-511.01 228.01,-527.86 259.35,-538.45"/> -<polygon fill="black" stroke="black" points="258.45,-541.84 269.04,-541.65 260.65,-535.19 258.45,-541.84"/> -<text text-anchor="middle" x="88.19" y="-282.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg26->Region25 --> -<g id="edge19" class="edge"> -<title>Phi_arg26->Region25</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M110.12,-264C112.58,-264 115.04,-264 117.5,-264"/> -<polygon fill="black" stroke="black" points="117.61,-267.5 127.61,-264 117.61,-260.5 117.61,-267.5"/> -<text text-anchor="middle" x="113.12" y="-257.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_28 --> -<g id="node15" class="node"> -<title>Con_28</title> -<ellipse fill="none" stroke="black" cx="343" cy="-464" rx="27" ry="18"/> -<text text-anchor="middle" x="343" y="-460.3" font-family="Times,serif" font-size="14.00">6</text> -</g> -<!-- EQ29 --> -<g id="node16" class="node"> -<title>EQ29</title> -<ellipse fill="none" stroke="black" cx="323" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="323" y="-360.3" font-family="Times,serif" font-size="14.00">==</text> -</g> -<!-- EQ29->Add16 --> -<g id="edge22" class="edge"> -<title>EQ29->Add16</title> -<path fill="none" stroke="black" d="M318.38,-381.96C314.84,-395.44 310.07,-414.81 307,-432 301.54,-462.56 297.63,-498.01 295.36,-521.8"/> -<polygon fill="black" stroke="black" points="291.86,-521.58 294.43,-531.86 298.83,-522.22 291.86,-521.58"/> -<text text-anchor="middle" x="315.38" y="-384.56" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ29->Con_28 --> -<g id="edge23" class="edge"> -<title>EQ29->Con_28</title> -<path fill="none" stroke="black" d="M326.48,-382.07C329.52,-396.97 333.99,-418.83 337.51,-436.08"/> -<polygon fill="black" stroke="black" points="334.13,-437.03 339.56,-446.13 340.99,-435.63 334.13,-437.03"/> -<text text-anchor="middle" x="323.48" y="-384.67" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If30->If19 --> -<g id="edge24" class="edge"> -<title>If30->If19:p1</title> -<path fill="none" stroke="red" d="M238.89,-296.32C232.15,-306.21 226.24,-317.72 223.98,-329.78"/> -<polygon fill="red" stroke="red" points="220.47,-329.71 223,-340 227.44,-330.38 220.47,-329.71"/> -<text text-anchor="middle" x="235.89" y="-298.92" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If30->EQ29 --> -<g id="edge25" class="edge"> -<title>If30->EQ29</title> -<path fill="none" stroke="black" d="M284.72,-296.01C292.51,-309.64 301.52,-325.42 308.85,-338.24"/> -<polygon fill="black" stroke="black" points="305.85,-340.04 313.85,-346.98 311.92,-336.56 305.85,-340.04"/> -<text text-anchor="middle" x="281.72" y="-298.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region36 --> -<g id="node18" class="node"> -<title>Region36</title> -<polygon fill="yellow" stroke="black" points="194,-196 128,-196 128,-160 194,-160 194,-196"/> -<text text-anchor="middle" x="161" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> -</g> -<!-- Region36->Region25 --> -<g id="edge26" class="edge"> -<title>Region36->Region25</title> -<path fill="none" stroke="red" d="M161,-196.4C161,-207.74 161,-222.77 161,-235.68"/> -<polygon fill="red" stroke="red" points="157.5,-235.9 161,-245.9 164.5,-235.9 157.5,-235.9"/> -<text text-anchor="middle" x="158" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region36->If30 --> -<g id="edge27" class="edge"> -<title>Region36->If30:p0</title> -<path fill="none" stroke="red" d="M174.84,-196.06C187.5,-211.53 205.8,-233.52 216.25,-244.39"/> -<polygon fill="red" stroke="red" points="214.12,-247.18 224,-251 218.66,-241.85 214.12,-247.18"/> -<text text-anchor="middle" x="171.84" y="-198.66" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg37 --> -<g id="node19" class="node"> -<title>Phi_arg37</title> -<ellipse fill="lightyellow" stroke="black" cx="73" cy="-178" rx="37.09" ry="18"/> -<text text-anchor="middle" x="73" y="-174.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg37->Add16 --> -<g id="edge30" class="edge"> -<title>Phi_arg37->Add16</title> -<path fill="none" stroke="black" d="M54.57,-194.1C44.32,-203.73 32.54,-217.16 27,-232 17.05,-258.65 8.44,-274.45 27,-296 97.38,-377.73 191.87,-254.61 267,-332 280.01,-345.4 288.39,-466.53 291.56,-521.77"/> -<polygon fill="black" stroke="black" points="288.07,-522.09 292.13,-531.88 295.06,-521.7 288.07,-522.09"/> -<text text-anchor="middle" x="51.57" y="-196.7" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg37->Phi_arg26 --> -<g id="edge29" class="edge"> -<title>Phi_arg37->Phi_arg26</title> -<path fill="none" stroke="black" d="M73,-196.4C73,-207.74 73,-222.77 73,-235.68"/> -<polygon fill="black" stroke="black" points="69.5,-235.9 73,-245.9 76.5,-235.9 69.5,-235.9"/> -<text text-anchor="middle" x="70" y="-199" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg37->Region36 --> -<g id="edge28" class="edge"> -<title>Phi_arg37->Region36</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M110.12,-178C112.58,-178 115.04,-178 117.5,-178"/> -<polygon fill="black" stroke="black" points="117.61,-181.5 127.61,-178 117.61,-174.5 117.61,-181.5"/> -<text text-anchor="middle" x="113.12" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return39->Region36 --> -<g id="edge31" class="edge"> -<title>Return39->Region36</title> -<path fill="none" stroke="red" d="M127.88,-124.3C132.99,-132.44 139.2,-142.31 144.84,-151.3"/> -<polygon fill="red" stroke="red" points="141.96,-153.29 150.25,-159.9 147.89,-149.57 141.96,-153.29"/> -<text text-anchor="middle" x="124.88" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return39->Phi_arg37 --> -<g id="edge32" class="edge"> -<title>Return39->Phi_arg37</title> -<path fill="none" stroke="black" d="M106.12,-124.3C100.93,-132.56 94.62,-142.61 88.9,-151.7"/> -<polygon fill="black" stroke="black" points="85.81,-150.05 83.45,-160.38 91.73,-153.77 85.81,-150.05"/> -<text text-anchor="middle" x="103.12" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="955" height="1390" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 955 1390" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(34,269)"><rect class="region-box" rx="8" width="667" height="706" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M449,1289 C449,1313 477.5,1316 477.5,1340" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #39 · CTRL</title></path><path class="edge CTRL" id="e6i1" d="M137,216 L137,339" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e6i2" d="M539,940 L539,950 L689,950 L689,322 L167,322 L167,342" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#6[2] → #20 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M257,216 L257,226 L269,226 L269,339" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M567,200.33333333333331 L567,210.33333333333331 L651,210.33333333333331 L651,218 L679,218 L679,330 L309,330 L309,342" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #16 · DATA</title></path><path class="edge DATA" id="e10i1" d="M289,395 L289,443" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #8 · DATA</title></path><path class="edge DATA" id="e10i2" d="M415,216 L415,226 L359,226 L359,405 L319,405 L319,443" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M137,395 L137,547" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #6 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M289,499 L289,509 L217,509 L217,547" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #10 · DATA</title></path><path class="edge DATA" id="e16i1" d="M289,395 L289,405 L46,405 L46,1000 L24,1000 L24,84 L567,84 L567,147.33333333333331" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #8 · DATA</title></path><path class="edge DATA" id="e16i2" d="M597,74 L597,147.33333333333331" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #15 · DATA</title></path><path class="edge DATA" id="e18i1" d="M567,203.33333333333331 L567,246 L419,246 L419,561.6666666666666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #16 · DATA</title></path><path class="edge DATA" id="e18i2" d="M719,216 L719,226 L449,226 L449,561.6666666666666" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #17 · DATA</title></path><path class="edge CTRL" id="e19i0" d="M117,647 L117,667 L339,667 L339,695" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#19[0] → #5 · CTRL</title></path><path class="edge DATA" id="e19i1" d="M419,617.6666666666666 L419,695" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#19[1] → #18 · DATA</title></path><path class="edge CTRL" id="e25i1" d="M237,647 L237,1028" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[1] → #7 · CTRL</title></path><path class="edge CTRL" id="e25i2" d="M319,795 L319,990 L267,990 L267,1028" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[2] → #12 · CTRL</title></path><path class="edge DATA" id="e26i1" d="M289,395 L289,405 L46,405 L46,1000 L369,1000 L369,1028" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#26[1] → #8 · DATA</title></path><path class="edge DATA" id="e26i2" d="M567,203.33333333333331 L567,246 L711,246 L711,990 L409,990 L409,1028" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#26[2] → #16 · DATA</title></path><path class="edge DATA" id="e29i1" d="M567,203.33333333333331 L567,246 L597,246 L597,709.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#29[1] → #16 · DATA</title></path><path class="edge DATA" id="e29i2" d="M871,216 L871,236 L627,236 L627,709.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#29[2] → #28 · DATA</title></path><path class="edge CTRL" id="e30i0" d="M439,795 L439,843" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#30[0] → #13 · CTRL</title></path><path class="edge DATA" id="e30i1" d="M597,765.6666666666667 L597,805 L519,805 L519,843" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#30[1] → #29 · DATA</title></path><path class="edge CTRL" id="e36i1" d="M237,1084 L237,1104 L429,1104 L429,1132" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#36[1] → #25 · CTRL</title></path><path class="edge CTRL" id="e36i2" d="M419,943 L419,1000 L459,1000 L459,1132" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#36[2] → #14 · CTRL</title></path><path class="edge DATA" id="e37i1" d="M389,1084 L389,1094 L561,1094 L561,1132" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[1] → #26 · DATA</title></path><path class="edge DATA" id="e37i2" d="M567,203.33333333333331 L567,246 L711,246 L711,990 L601,990 L601,1132" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[2] → #16 · DATA</title></path><path class="edge CTRL" id="e39i0" d="M429,1188 L429,1236" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#39[0] → #36 · CTRL</title></path><path class="edge DATA" id="e39i1" d="M581,1188 L581,1198 L469,1198 L469,1236" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#39[1] → #37 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(77,166)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(77,122)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(441.5,1340)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #39 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(197,166)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(57,597)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(77,345)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #20 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n7" data-id="7" transform="translate(177,597)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #7/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(229,345)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 φ_arg +Type not computed + +[0] → #6 ASSOC +[1] → #4 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #6</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(355,166)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 10 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(229,449)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(57,553)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #6 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n12" data-id="12" transform="translate(259,745)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #12/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 True +Projection 0 of #19 +Type not computed + +[0] → #19 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(379,745)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #13/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 False +Projection 1 of #19 +Type not computed + +[0] → #19 CTRL</title></g><g class="node" id="n14" data-id="14" transform="translate(359,893)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #14/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 True +Projection 0 of #30 +Type not computed + +[0] → #30 CTRL</title></g><g class="node" id="n15" data-id="15" transform="translate(537,24)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #15</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 1 +Type not computed + +</title></g><g class="node" id="n16" data-id="16" transform="translate(507,153.33333333333331)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #15 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(659,166)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>5</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 5 +Type not computed + +</title></g><g class="node" id="n18" data-id="18" transform="translate(359,567.6666666666666)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 == +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #17 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n19" data-id="19" transform="translate(259,701)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #19</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#19 If +Type not computed + +[0] → #5 CTRL +[1] → #18 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n20" data-id="20" transform="translate(479,893)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #20/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 False +Projection 1 of #30 +Type not computed + +[0] → #30 CTRL</title></g><g class="node" id="n25" data-id="25" transform="translate(177,1034)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 Region +Type not computed + +[0] → — DATA +[1] → #7 CTRL +[2] → #12 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n26" data-id="26" transform="translate(329,1034)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #26</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#26 φ_arg +Type not computed + +[0] → #25 ASSOC +[1] → #8 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #25</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n28" data-id="28" transform="translate(811,166)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>6</tspan><tspan class="node-id">  #28</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#28 6 +Type not computed + +</title></g><g class="node" id="n29" data-id="29" transform="translate(537,715.6666666666667)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #29</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#29 == +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #28 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n30" data-id="30" transform="translate(359,849)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #30</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#30 If +Type not computed + +[0] → #13 CTRL +[1] → #29 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n36" data-id="36" transform="translate(369,1138)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #36</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#36 Region +Type not computed + +[0] → — DATA +[1] → #25 CTRL +[2] → #14 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n37" data-id="37" transform="translate(521,1138)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #37</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#37 φ_arg +Type not computed + +[0] → #36 ASSOC +[1] → #26 DATA +[2] → #16 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #36</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n39" data-id="39" transform="translate(389,1242)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #39</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#39 Return +Type not computed + +[0] → #36 CTRL +[1] → #37 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(34,269)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #6</tspan></text><title>Loop · 14 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #6"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter08/docs/Makefile b/chapter08/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter08/docs/Makefile +++ b/chapter08/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter09/README.md b/chapter09/README.md index d3b55a19..2a9abe4e 100644 --- a/chapter09/README.md +++ b/chapter09/README.md @@ -1,17 +1,19 @@ # Chapter 9: Global Value Numbering and Iterative Peepholes +[Previous: Chapter 8](../chapter08/README.md) | +[Next: Chapter 10a](../chapter10a/README.md) + # Table of Contents 1. [Engineering Peepholes](#engineering-peepholes) 2. [Global Value Numbering](#global-value-numbering) 3. [Post-Parse Iterative Peepholes](#post-parse-iterative-peepholes) 4. [Distant Neighbors](#distant-neighbors) -5. [Identification of Basic Blocks in SoN graph](#identification-of-basic-blocks-in-son-graph) -6. [Other Concerns](#other-concerns) -7. [Common SubExpressions via GVN](#common-subexpressions-via-gvn) - - [Example 1](#example-1) - - [Example 2](#example-2) -8. [Post Parse Iterative Optimizations](#post-parse-iterative-optimizations) +5. [Other Concerns](#other-concerns) +6. [Common SubExpressions via GVN](#common-subexpressions-via-gvn) + - [Example 1](#example-1) + - [Example 2](#example-2) +7. [Post Parse Iterative Optimizations](#post-parse-iterative-optimizations) You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter09) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter08...linear-chapter09) it to the previous chapter. @@ -41,7 +43,7 @@ opcode and inputs. If two Nodes do the same function on the same inputs, they get the same result - and can be shared. * We add a global static hash table `GVN` in Node. -* We add a `Node.equals` call. Two Nodes are equals if they have the same +* We add a `Node.equals` call. Two Nodes are equal if they have the same opcode - same Java class - on the same inputs. * We add a `hashCode` on the Node opcode (proxy: Node string name) and inputs. * `ConstantNode` and a few others need some extra custom bits here: the @@ -50,8 +52,7 @@ get the same result - and can be shared. Note the intentional *value* equality here. In many places in Simple we use *reference* equality - e.g. node/edge maintenance is via reference equality, not -value equality, so e.g. the `Utils.find()` call finds via reference. Through -out the Simple project whenever a Node lookup is happening, beware if its via +value equality, so e.g. the `Utils.find()` call finds via reference. Throughout the Simple project whenever a Node lookup is happening, beware if it's via *value* or *reference* equality; this is not always explicitly called out but should be obvious from context. @@ -72,7 +73,7 @@ remove the Node from `GVN` first, before modifying the edges. "edge-locked" and IS in `GVN`. * The `hashCode` function uses the cached hash if available and disallows an accidental zero hash. -* We add a `unlock()` call to remove a Node from `GVN` before any edge is +* We add an `unlock()` call to remove a Node from `GVN` before any edge is changed. This is inserted in front of all calls which hack Node edges. All edge modify code paths already ensure the Node is re-peepholed, and during this revisit the Node will get re-inserted in the `GVN` table. @@ -112,19 +113,19 @@ Rinse, Repeat until the worklist runs dry. The main issues we have to deal with: * Nodes have uses; replacing some set of Nodes with another requires more graph - reworking. Not rocket science, but it can be fiddly. Its helpful to have a + reworking. Not rocket science, but it can be fiddly. It's helpful to have a small set of graph munging utilities, and the strong invariant that the graph is stable and correct between peepholes. In our case `Node.subsume` does most of the munging, building on our prior stable Node utilities. -* Changing a Node also changes the graph "neighborhood". The neigbors need to +* Changing a Node also changes the graph "neighborhood". The neighbors need to be checked to see if THEY can also peephole, and so on. After any peephole - or graph update we put a Nodes uses and defs on the worklist. + or graph update we put a Node's uses and defs on the worklist. * Our strong invariant is that for all Nodes, either they are on the worklist OR no peephole applies. This invariant is easy to check, although expensive. Basically the normal "iterate peepholes to a fixed point" is linear, and this - check is linear at each peephole step... so quadratic overall. Its a useful + check is linear at each peephole step... so quadratic overall. It's a useful assert, but one we can disable once the overall algorithm is stable - and then turn it back on again when some new set of peepholes is misbehaving. The code for this is turned on in `IterPeeps.iterate` as `assert @@ -143,11 +144,11 @@ Updating "B" throws the dependent list ("this") onto the "todo" list. An example of a distant neighbor check is in `AddNode`, where we check for stacked constants: `(Add (Add x 2) 1)` and we'd like `(Add x 3)` instead. Suppose we're doing this check and we find instead `(Add (Phi (Add x 2) self) -1)` The check naturally bails out at the `Phi` since its not an `Add`, but the +1)` The check naturally bails out at the `Phi` since it's not an `Add`, but the `(Phi y self)` only has one unique input, and will itself peephole to `y` eventually. When it does, our stacked `Add` peephole can apply. So the failing Add peephole calls `phi.addDep(Add)` and registers a dependency on the -`Phi`. If the `Phi` indeed later optimizes, we add its depencencies (e.g. the +`Phi`. If the `Phi` indeed later optimizes, we add its dependencies (e.g. the `Add`) back on our `IterPeeps` worklist and retry the stacked Add peephole. The general rule is: @@ -173,7 +174,7 @@ In this chapter we trigger on following patterns Changes: -* We add a `ArrayList<Node> _deps` field to Node; initially null. +* We add an `ArrayList<Node> _deps` field to Node; initially null. * Some peepholes (see above) add dependencies if they fail a remote check, by calling `distant.addDep(this)`. The `addDep` call creates `_deps` and filters for various kinds of duplicate adds. @@ -191,7 +192,7 @@ There are more issues we will want to deal with in a later Chapter: - Dead infinite loops often lead to infinite peephole cycles... if only we would get around to working on the "base" of the dead loop it would fold up. - - Some peepholes naturally reduce the graph directly; while some keeps its + - Some peepholes naturally reduce the graph directly; while some keep its size the same but reduce other things (e.g. swapping a Mul-by-2 with a Shift), and we might end up with a few which try to grow the graph briefly before collapsing. @@ -211,15 +212,15 @@ There are more issues we will want to deal with in a later Chapter: many peep patterns might go quadratic if approached from one end or another, because they modify something then push it back onto the list where it immediately gets pulled again. I.e., you end up spinning in a loop repeating - the same peeps while slowly migrating a e.g. left-spine add-tree into a - right-spine add-tree. A psuedo-random pull uses randomization to defeat bad + the same peeps while slowly migrating e.g. left-spine add-tree into a + right-spine add-tree. A pseudo-random pull uses randomization to defeat bad peep patterns. * Why isn't `IterPeeps` just passing over all of the Nodes once or twice, instead of using a worklist with the `addDeps` mechanism? We could even visit them in a defs-before-uses order (e.g. Reverse Post Order). - In the absense of loops exactly one such pass will find all local peepholes, + In the absence of loops exactly one such pass will find all local peepholes, and indeed the Parser already does this. However, this will fail to find opportunities at loops and farther remote cases - and to get those peepholes around loops will require another visit. It is easy to construct a case @@ -249,7 +250,7 @@ else { return x; ``` -Prior to GVN, this would result in following graph. Note that the `arg+arg` is translated to `arg*2`. +Prior to GVN, this would result in the following graph. Note that the `arg+arg` is translated to `arg*2`.  @@ -269,8 +270,8 @@ Without GVN the peepholes cannot see that both sides of the subtraction have the  -- Each multiplication(*) node has two edges going to `arg`. -- In the example above, we fused them to make the graph more readable. +- Each multiplication(*) node has two edges going to `arg`. +- The input-slot labels distinguish these two uses of the same definition. With GVN, the peepholes can do a better job: @@ -290,7 +291,7 @@ return arg; ``` While parsing the `while` loop it is not yet known that `step` is a constant and will not change. Therefore, -without the post parse optimization we get following: +without the post parse optimization we get the following:  diff --git a/chapter09/docs/09-graph1.json b/chapter09/docs/09-graph1.json new file mode 100644 index 00000000..746d4de2 --- /dev/null +++ b/chapter09/docs/09-graph1.json @@ -0,0 +1,28 @@ +{ + "ver": 1, + "comp": "chapter09/docs/09-graph1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}, {"idx": 1, "def": 24, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 7, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 17, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 21, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 20, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 21, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter09/docs/09-graph1.svg b/chapter09/docs/09-graph1.svg index fce8d53c..e639b36b 100644 --- a/chapter09/docs/09-graph1.svg +++ b/chapter09/docs/09-graph1.svg @@ -1,222 +1,130 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter08 Pages: 1 --> -<svg width="350pt" height="420pt" - viewBox="0.00 0.00 350.00 420.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 416)"> -<title>chapter08</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-416 346,-416 346,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-404 334,-404 334,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="56,-367 56,-392 137,-392 137,-367 56,-367"/> -<polygon fill="none" stroke="black" points="56,-367 56,-392 137,-392 137,-367 56,-367"/> -<text text-anchor="start" x="78" y="-375.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="56,-336 56,-367 137,-367 137,-336 56,-336"/> -<polygon fill="yellow" stroke="transparent" points="61,-341 61,-362 101,-362 101,-341 61,-341"/> -<polygon fill="none" stroke="black" points="61,-341 61,-362 101,-362 101,-341 61,-341"/> -<text text-anchor="start" x="64" y="-347.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="101,-341 101,-362 132,-362 132,-341 101,-341"/> -<text text-anchor="start" x="104" y="-347.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="175,-52 121,-52 121,-16 175,-16 175,-52"/> -<text text-anchor="middle" x="148" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return18 --> -<g id="node10" class="node"> -<title>Return18</title> -<polygon fill="yellow" stroke="black" points="139,-124 73,-124 73,-88 139,-88 139,-124"/> -<text text-anchor="middle" x="106" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return18 --> -<g id="edge1" class="edge"> -<title>Stop3->Return18</title> -<path fill="none" stroke="red" d="M137.62,-52.3C132.74,-60.44 126.81,-70.31 121.42,-79.3"/> -<polygon fill="red" stroke="red" points="118.41,-77.52 116.26,-87.9 124.41,-81.12 118.41,-77.52"/> -<text text-anchor="middle" x="134.62" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return24 --> -<g id="node13" class="node"> -<title>Return24</title> -<polygon fill="yellow" stroke="black" points="223,-124 157,-124 157,-88 223,-88 223,-124"/> -<text text-anchor="middle" x="190" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return24 --> -<g id="edge2" class="edge"> -<title>Stop3->Return24</title> -<path fill="none" stroke="red" d="M158.38,-52.3C163.26,-60.44 169.19,-70.31 174.58,-79.3"/> -<polygon fill="red" stroke="red" points="171.59,-81.12 179.74,-87.9 177.59,-77.52 171.59,-81.12"/> -<text text-anchor="middle" x="155.38" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_7 --> -<g id="node3" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="262" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="262" y="-360.3" font-family="Times,serif" font-size="14.00">2</text> -</g> -<!-- Mul8 --> -<g id="node4" class="node"> -<title>Mul8</title> -<ellipse fill="none" stroke="black" cx="227" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="227" y="-274.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Mul8->Start2 --> -<g id="edge3" class="edge"> -<title>Mul8->Start2:p1</title> -<path fill="none" stroke="black" d="M208.6,-291.54C193.58,-301.96 172,-317.39 154,-332 147.74,-337.08 146.05,-343.45 142.33,-347.37"/> -<polygon fill="black" stroke="black" points="141.05,-344.11 133,-351 143.59,-350.64 141.05,-344.11"/> -<text text-anchor="middle" x="205.6" y="-294.14" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Mul8->Con_7 --> -<g id="edge4" class="edge"> -<title>Mul8->Con_7</title> -<path fill="none" stroke="black" d="M233.91,-295.6C238.85,-307.45 245.59,-323.62 251.23,-337.15"/> -<polygon fill="black" stroke="black" points="248.02,-338.55 255.1,-346.44 254.48,-335.86 248.02,-338.55"/> -<text text-anchor="middle" x="230.91" y="-298.2" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Con_9 --> -<g id="node5" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="190" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="190" y="-360.3" font-family="Times,serif" font-size="14.00">10</text> -</g> -<!-- LT10 --> -<g id="node6" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="155" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="155" y="-274.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Start2 --> -<g id="edge5" class="edge"> -<title>LT10->Start2:p1</title> -<path fill="none" stroke="black" d="M139.98,-293.02C131.35,-302.35 121.57,-315.51 118.21,-329.88"/> -<polygon fill="black" stroke="black" points="114.71,-329.65 117,-340 121.66,-330.49 114.71,-329.65"/> -<text text-anchor="middle" x="136.98" y="-295.62" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT10->Con_9 --> -<g id="edge6" class="edge"> -<title>LT10->Con_9</title> -<path fill="none" stroke="black" d="M161.91,-295.6C166.85,-307.45 173.59,-323.62 179.23,-337.15"/> -<polygon fill="black" stroke="black" points="176.02,-338.55 183.1,-346.44 182.48,-335.86 176.02,-338.55"/> -<text text-anchor="middle" x="158.91" y="-298.2" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11 --> -<g id="node7" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="102,-195 102,-220 196,-220 196,-195 102,-195"/> -<polygon fill="none" stroke="black" points="102,-195 102,-220 196,-220 196,-195 102,-195"/> -<text text-anchor="start" x="143.5" y="-203.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="102,-164 102,-195 196,-195 196,-164 102,-164"/> -<polygon fill="yellow" stroke="transparent" points="107,-169 107,-190 147,-190 147,-169 107,-169"/> -<polygon fill="none" stroke="black" points="107,-169 107,-190 147,-190 147,-169 107,-169"/> -<text text-anchor="start" x="110" y="-175.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="147,-169 147,-190 191,-190 191,-169 147,-169"/> -<polygon fill="none" stroke="black" points="147,-169 147,-190 191,-190 191,-169 147,-169"/> -<text text-anchor="start" x="150" y="-175.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If11->Start2 --> -<g id="edge7" class="edge"> -<title>If11->Start2:p0</title> -<path fill="none" stroke="red" d="M133.74,-224.23C117.53,-257.6 93.05,-308.62 84.28,-330.23"/> -<polygon fill="red" stroke="red" points="80.86,-329.41 81,-340 87.5,-331.63 80.86,-329.41"/> -<text text-anchor="middle" x="130.74" y="-226.83" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT10 --> -<g id="edge8" class="edge"> -<title>If11->LT10</title> -<path fill="none" stroke="black" d="M151.23,-224.28C151.83,-232.58 152.46,-241.48 153.04,-249.56"/> -<polygon fill="black" stroke="black" points="149.55,-249.87 153.76,-259.6 156.54,-249.37 149.55,-249.87"/> -<text text-anchor="middle" x="148.23" y="-226.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_16 --> -<g id="node8" class="node"> -<title>Con_16</title> -<ellipse fill="none" stroke="black" cx="43" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-274.3" font-family="Times,serif" font-size="14.00">2</text> -</g> -<!-- Mul17 --> -<g id="node9" class="node"> -<title>Mul17</title> -<ellipse fill="none" stroke="black" cx="49" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="49" y="-188.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Mul17->Start2 --> -<g id="edge9" class="edge"> -<title>Mul17->Start2:p1</title> -<path fill="none" stroke="black" d="M58.46,-208.9C75.17,-237.54 108.83,-297.79 115.74,-329.91"/> -<polygon fill="black" stroke="black" points="112.29,-330.51 117,-340 119.24,-329.64 112.29,-330.51"/> -<text text-anchor="middle" x="55.46" y="-211.5" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Mul17->Con_16 --> -<g id="edge10" class="edge"> -<title>Mul17->Con_16</title> -<path fill="none" stroke="black" d="M47.79,-210C46.98,-221.31 45.9,-236.42 44.97,-249.43"/> -<polygon fill="black" stroke="black" points="41.45,-249.51 44.23,-259.74 48.44,-250.01 41.45,-249.51"/> -<text text-anchor="middle" x="44.79" y="-212.6" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return18->If11 --> -<g id="edge11" class="edge"> -<title>Return18->If11:p0</title> -<path fill="none" stroke="red" d="M115.27,-124.08C119.67,-133.41 124.35,-145.54 126.19,-157.76"/> -<polygon fill="red" stroke="red" points="122.72,-158.31 127,-168 129.7,-157.76 122.72,-158.31"/> -<text text-anchor="middle" x="112.27" y="-126.68" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return18->Mul17 --> -<g id="edge12" class="edge"> -<title>Return18->Mul17</title> -<path fill="none" stroke="black" d="M94.19,-124.4C85.84,-136.7 74.55,-153.35 65.34,-166.92"/> -<polygon fill="black" stroke="black" points="62.36,-165.08 59.64,-175.32 68.15,-169.01 62.36,-165.08"/> -<text text-anchor="middle" x="91.19" y="-127" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_20 --> -<g id="node11" class="node"> -<title>Con_20</title> -<ellipse fill="none" stroke="black" cx="299" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="299" y="-274.3" font-family="Times,serif" font-size="14.00">1</text> -</g> -<!-- Add21 --> -<g id="node12" class="node"> -<title>Add21</title> -<ellipse fill="none" stroke="black" cx="249" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="249" y="-188.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add21->Mul8 --> -<g id="edge13" class="edge"> -<title>Add21->Mul8</title> -<path fill="none" stroke="black" d="M244.55,-210C241.54,-221.5 237.49,-236.93 234.05,-250.08"/> -<polygon fill="black" stroke="black" points="230.59,-249.47 231.45,-260.03 237.36,-251.24 230.59,-249.47"/> -<text text-anchor="middle" x="241.55" y="-212.6" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add21->Con_20 --> -<g id="edge14" class="edge"> -<title>Add21->Con_20</title> -<path fill="none" stroke="black" d="M258.64,-209.2C265.9,-221.4 275.99,-238.34 284.26,-252.24"/> -<polygon fill="black" stroke="black" points="281.27,-254.05 289.39,-260.85 287.28,-250.47 281.27,-254.05"/> -<text text-anchor="middle" x="255.64" y="-211.8" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return24->If11 --> -<g id="edge15" class="edge"> -<title>Return24->If11:p1</title> -<path fill="none" stroke="red" d="M180.73,-124.08C176.33,-133.41 171.65,-145.54 169.81,-157.76"/> -<polygon fill="red" stroke="red" points="166.3,-157.76 169,-168 173.28,-158.31 166.3,-157.76"/> -<text text-anchor="middle" x="177.73" y="-126.68" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return24->Add21 --> -<g id="edge16" class="edge"> -<title>Return24->Add21</title> -<path fill="none" stroke="black" d="M202.22,-124.4C210.86,-136.7 222.55,-153.35 232.09,-166.92"/> -<polygon fill="black" stroke="black" points="229.37,-169.15 237.98,-175.32 235.1,-165.12 229.37,-169.15"/> -<text text-anchor="middle" x="199.22" y="-127" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="847" height="572" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 847 572" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M236,471 C236,495 411.5,498 411.5,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #18 · CTRL</title></path><path class="edge CTRL" id="e3i1" d="M388,471 C388,495 435.5,498 435.5,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[1] → #24 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M356,118 L356,138 L611,138 L611,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M666,118 L666,128 L641,128 L641,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge DATA" id="e10i1" d="M356,118 L356,138 L307,138 L307,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #4 · DATA</title></path><path class="edge DATA" id="e10i2" d="M84,118 L84,148 L337,148 L337,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M236,118 L236,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #1 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M307,222 L307,232 L316,232 L316,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #10 · DATA</title></path><path class="edge DATA" id="e17i1" d="M356,118 L356,138 L459,138 L459,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #4 · DATA</title></path><path class="edge DATA" id="e17i2" d="M514,118 L514,128 L489,128 L489,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[2] → #16 · DATA</title></path><path class="edge CTRL" id="e18i0" d="M216,370 L216,418" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#18[0] → #5 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M459,222 L459,380 L256,380 L256,418" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #17 · DATA</title></path><path class="edge DATA" id="e21i1" d="M611,222 L611,284.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #8 · DATA</title></path><path class="edge DATA" id="e21i2" d="M763,222 L763,232 L641,232 L641,284.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[2] → #20 · DATA</title></path><path class="edge CTRL" id="e24i0" d="M336,370 L336,390 L368,390 L368,418" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#24[0] → #6 · CTRL</title></path><path class="edge DATA" id="e24i1" d="M611,340.6666666666667 L611,390 L408,390 L408,418" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[1] → #21 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(387.5,522)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #18 CTRL +[1] → #24 CTRL</title><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="48" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="48" y="-7" text-anchor="middle">1</text></g><g class="node" id="n4" data-id="4" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(156,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(276,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(606,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>2</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 2 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(551,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 * +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>10</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 10 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(247,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(156,276)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #1 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n16" data-id="16" transform="translate(454,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>2</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 2 +Type not computed + +</title></g><g class="node" id="n17" data-id="17" transform="translate(399,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 * +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #16 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(176,424)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 Return +Type not computed + +[0] → #5 CTRL +[1] → #17 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n20" data-id="20" transform="translate(703,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>1</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 1 +Type not computed + +</title></g><g class="node" id="n21" data-id="21" transform="translate(551,290.6666666666667)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #20 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n24" data-id="24" transform="translate(328,424)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 Return +Type not computed + +[0] → #6 CTRL +[1] → #21 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter09/docs/09-graph2.json b/chapter09/docs/09-graph2.json new file mode 100644 index 00000000..5b449041 --- /dev/null +++ b/chapter09/docs/09-graph2.json @@ -0,0 +1,26 @@ +{ + "ver": 1, + "comp": "chapter09/docs/09-graph2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}, {"idx": 1, "def": 24, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 7, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "#10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 24, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter09/docs/09-graph2.svg b/chapter09/docs/09-graph2.svg index 111ec172..a2484f5c 100644 --- a/chapter09/docs/09-graph2.svg +++ b/chapter09/docs/09-graph2.svg @@ -1,196 +1,122 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter09 Pages: 1 --> -<svg width="289pt" height="420pt" - viewBox="0.00 0.00 289.00 420.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 416)"> -<title>chapter09</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-416 285,-416 285,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-404 273,-404 273,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="97,-367 97,-392 178,-392 178,-367 97,-367"/> -<polygon fill="none" stroke="black" points="97,-367 97,-392 178,-392 178,-367 97,-367"/> -<text text-anchor="start" x="119" y="-375.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="97,-336 97,-367 178,-367 178,-336 97,-336"/> -<polygon fill="yellow" stroke="transparent" points="102,-341 102,-362 142,-362 142,-341 102,-341"/> -<polygon fill="none" stroke="black" points="102,-341 102,-362 142,-362 142,-341 102,-341"/> -<text text-anchor="start" x="105" y="-347.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="142,-341 142,-362 173,-362 173,-341 142,-341"/> -<text text-anchor="start" x="145" y="-347.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="164,-52 110,-52 110,-16 164,-16 164,-52"/> -<text text-anchor="middle" x="137" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return18 --> -<g id="node8" class="node"> -<title>Return18</title> -<polygon fill="yellow" stroke="black" points="128,-124 62,-124 62,-88 128,-88 128,-124"/> -<text text-anchor="middle" x="95" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return18 --> -<g id="edge1" class="edge"> -<title>Stop3->Return18</title> -<path fill="none" stroke="red" d="M126.62,-52.3C121.74,-60.44 115.81,-70.31 110.42,-79.3"/> -<polygon fill="red" stroke="red" points="107.41,-77.52 105.26,-87.9 113.41,-81.12 107.41,-77.52"/> -<text text-anchor="middle" x="123.62" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return24 --> -<g id="node11" class="node"> -<title>Return24</title> -<polygon fill="yellow" stroke="black" points="212,-124 146,-124 146,-88 212,-88 212,-124"/> -<text text-anchor="middle" x="179" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return24 --> -<g id="edge2" class="edge"> -<title>Stop3->Return24</title> -<path fill="none" stroke="red" d="M147.38,-52.3C152.26,-60.44 158.19,-70.31 163.58,-79.3"/> -<polygon fill="red" stroke="red" points="160.59,-81.12 168.74,-87.9 166.59,-77.52 160.59,-81.12"/> -<text text-anchor="middle" x="144.38" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_7 --> -<g id="node3" class="node"> -<title>Con_7</title> -<ellipse fill="none" stroke="black" cx="43" cy="-364" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-360.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Mul8 --> -<g id="node4" class="node"> -<title>Mul8</title> -<ellipse fill="none" stroke="black" cx="94" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="94" y="-274.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Mul8->Start2 --> -<g id="edge3" class="edge"> -<title>Mul8->Start2:p1</title> -<path fill="none" stroke="black" d="M116.03,-288.88C131.86,-297.42 151.32,-311.35 156.62,-330.09"/> -<polygon fill="black" stroke="black" points="153.15,-330.58 158,-340 160.08,-329.61 153.15,-330.58"/> -<text text-anchor="middle" x="119.03" y="-291.48" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Mul8->Con_7 --> -<g id="edge4" class="edge"> -<title>Mul8->Con_7</title> -<path fill="none" stroke="black" d="M84.17,-295.2C76.71,-307.48 66.34,-324.56 57.87,-338.51"/> -<polygon fill="black" stroke="black" points="54.83,-336.77 52.63,-347.14 60.81,-340.41 54.83,-336.77"/> -<text text-anchor="middle" x="81.17" y="-297.8" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- LT9 --> -<g id="node5" class="node"> -<title>LT9</title> -<ellipse fill="none" stroke="black" cx="166" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="166" y="-274.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT9->Start2 --> -<g id="edge5" class="edge"> -<title>LT9->Start2:p1</title> -<path fill="none" stroke="black" d="M162.56,-296.01C160.87,-305.54 159.04,-317.9 158.32,-329.98"/> -<polygon fill="black" stroke="black" points="154.82,-329.89 158,-340 161.81,-330.12 154.82,-329.89"/> -<text text-anchor="middle" x="159.56" y="-298.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_10 --> -<g id="node6" class="node"> -<title>Con_10</title> -<ellipse fill="none" stroke="black" cx="234" cy="-364" rx="30.59" ry="18"/> -<text text-anchor="middle" x="234" y="-360.3" font-family="Times,serif" font-size="14.00">#10</text> -</g> -<!-- LT9->Con_10 --> -<g id="edge6" class="edge"> -<title>LT9->Con_10</title> -<path fill="none" stroke="black" d="M178.47,-294.41C188.66,-307 203.24,-325 214.9,-339.41"/> -<polygon fill="black" stroke="black" points="212.36,-341.84 221.38,-347.41 217.8,-337.43 212.36,-341.84"/> -<text text-anchor="middle" x="175.47" y="-297.01" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If11 --> -<g id="node7" class="node"> -<title>If11</title> -<polygon fill="yellow" stroke="transparent" points="91,-195 91,-220 185,-220 185,-195 91,-195"/> -<polygon fill="none" stroke="black" points="91,-195 91,-220 185,-220 185,-195 91,-195"/> -<text text-anchor="start" x="132.5" y="-203.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="91,-164 91,-195 185,-195 185,-164 91,-164"/> -<polygon fill="yellow" stroke="transparent" points="96,-169 96,-190 136,-190 136,-169 96,-169"/> -<polygon fill="none" stroke="black" points="96,-169 96,-190 136,-190 136,-169 96,-169"/> -<text text-anchor="start" x="99" y="-175.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="136,-169 136,-190 180,-190 180,-169 136,-169"/> -<polygon fill="none" stroke="black" points="136,-169 136,-190 180,-190 180,-169 136,-169"/> -<text text-anchor="start" x="139" y="-175.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- If11->Start2 --> -<g id="edge7" class="edge"> -<title>If11->Start2:p0</title> -<path fill="none" stroke="red" d="M87.32,-224.07C75.52,-233.97 64.51,-246.05 58,-260 51.23,-274.5 52.79,-280.87 58,-296 59.97,-301.73 80.37,-332.08 92.9,-345.08"/> -<polygon fill="red" stroke="red" points="90.86,-347.92 101,-351 94.99,-342.27 90.86,-347.92"/> -<text text-anchor="middle" x="84.32" y="-226.67" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If11->LT9 --> -<g id="edge8" class="edge"> -<title>If11->LT9</title> -<path fill="none" stroke="black" d="M148.43,-224.28C151.3,-232.9 154.39,-242.17 157.16,-250.49"/> -<polygon fill="black" stroke="black" points="153.87,-251.69 160.36,-260.07 160.51,-249.48 153.87,-251.69"/> -<text text-anchor="middle" x="145.43" y="-226.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return18->Mul8 --> -<g id="edge10" class="edge"> -<title>Return18->Mul8</title> -<path fill="none" stroke="black" d="M86.28,-124.17C81.63,-134.31 76.38,-147.56 74,-160 68.67,-187.94 68.9,-196.02 74,-224 75.67,-233.18 78.85,-242.83 82.19,-251.35"/> -<polygon fill="black" stroke="black" points="79.03,-252.85 86.11,-260.73 85.49,-250.15 79.03,-252.85"/> -<text text-anchor="middle" x="83.28" y="-126.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return18->If11 --> -<g id="edge9" class="edge"> -<title>Return18->If11:p0</title> -<path fill="none" stroke="red" d="M104.27,-124.08C108.67,-133.41 113.35,-145.54 115.19,-157.76"/> -<polygon fill="red" stroke="red" points="111.72,-158.31 116,-168 118.7,-157.76 111.72,-158.31"/> -<text text-anchor="middle" x="101.27" y="-126.68" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add20 --> -<g id="node9" class="node"> -<title>Add20</title> -<ellipse fill="none" stroke="black" cx="238" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="238" y="-188.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add20->Mul8 --> -<g id="edge11" class="edge"> -<title>Add20->Mul8</title> -<path fill="none" stroke="black" d="M223.27,-207.18C217,-212.81 209.43,-219.09 202,-224 194.96,-228.65 153.81,-248.53 124.4,-262.57"/> -<polygon fill="black" stroke="black" points="122.84,-259.44 115.32,-266.9 125.85,-265.75 122.84,-259.44"/> -<text text-anchor="middle" x="220.27" y="-209.78" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_21 --> -<g id="node10" class="node"> -<title>Con_21</title> -<ellipse fill="none" stroke="black" cx="238" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="238" y="-274.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Add20->Con_21 --> -<g id="edge12" class="edge"> -<title>Add20->Con_21</title> -<path fill="none" stroke="black" d="M238,-210.4C238,-221.74 238,-236.77 238,-249.68"/> -<polygon fill="black" stroke="black" points="234.5,-249.9 238,-259.9 241.5,-249.9 234.5,-249.9"/> -<text text-anchor="middle" x="235" y="-213" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return24->If11 --> -<g id="edge13" class="edge"> -<title>Return24->If11:p1</title> -<path fill="none" stroke="red" d="M169.73,-124.08C165.33,-133.41 160.65,-145.54 158.81,-157.76"/> -<polygon fill="red" stroke="red" points="155.3,-157.76 158,-168 162.28,-158.31 155.3,-157.76"/> -<text text-anchor="middle" x="166.73" y="-126.68" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return24->Add20 --> -<g id="edge14" class="edge"> -<title>Return24->Add20</title> -<path fill="none" stroke="black" d="M191.22,-124.4C199.86,-136.7 211.55,-153.35 221.09,-166.92"/> -<polygon fill="black" stroke="black" points="218.37,-169.15 226.98,-175.32 224.1,-165.12 218.37,-169.15"/> -<text text-anchor="middle" x="188.22" y="-127" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="618" height="572" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 618 572" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,471 C104,495 297,498 297,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #18 · CTRL</title></path><path class="edge CTRL" id="e3i1" d="M256,471 C256,495 321,498 321,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[1] → #24 · CTRL</title></path><path class="edge DATA" id="e8i1" d="M224,118 L224,128 L336,128 L336,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA</title></path><path class="edge DATA" id="e8i2" d="M534,118 L534,148 L366,148 L366,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge DATA" id="e9i1" d="M224,118 L224,128 L184,128 L184,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M382,118 L382,138 L214,138 L214,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #10 · DATA</title></path><path class="edge CTRL" id="e11i0" d="M104,118 L104,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[0] → #1 · CTRL</title></path><path class="edge DATA" id="e11i1" d="M184,222 L184,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#11[1] → #9 · DATA</title></path><path class="edge CTRL" id="e18i0" d="M84,370 L84,418" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#18[0] → #5 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M336,222 L336,232 L280,232 L280,380 L124,380 L124,418" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #8 · DATA</title></path><path class="edge DATA" id="e20i1" d="M336,222 L336,232 L351,232 L351,284.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[1] → #8 · DATA</title></path><path class="edge DATA" id="e20i2" d="M488,222 L488,232 L381,232 L381,284.6666666666667" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#20[2] → #21 · DATA</title></path><path class="edge CTRL" id="e24i0" d="M204,370 L204,390 L236,390 L236,418" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#24[0] → #6 · CTRL</title></path><path class="edge DATA" id="e24i1" d="M351,340.6666666666667 L351,390 L276,390 L276,418" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#24[1] → #20 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(44,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(44,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(273,522)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #18 CTRL +[1] → #24 CTRL</title><circle class="port" cx="24" cy="0" r="3" fill="#536477"/><circle class="port" cx="48" cy="0" r="3" fill="#536477"/><text class="slot" x="24" y="-7" text-anchor="middle">0</text><text class="slot" x="48" y="-7" text-anchor="middle">1</text></g><g class="node" id="n4" data-id="4" transform="translate(164,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(24,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(144,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #11 +Type not computed + +[0] → #11 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(474,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 #2 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(276,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 * +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(124,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 < +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #10 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(322,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#10</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 #10 +Type not computed + +</title></g><g class="node" id="n11" data-id="11" transform="translate(24,276)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#11 If +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n18" data-id="18" transform="translate(44,424)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 Return +Type not computed + +[0] → #5 CTRL +[1] → #8 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n20" data-id="20" transform="translate(291,290.6666666666667)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #20</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#20 + +Type not computed + +[0] → — DATA +[1] → #8 DATA +[2] → #21 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n21" data-id="21" transform="translate(428,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 #1 +Type not computed + +</title></g><g class="node" id="n24" data-id="24" transform="translate(196,424)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 Return +Type not computed + +[0] → #6 CTRL +[1] → #20 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter09/docs/09-graph3.json b/chapter09/docs/09-graph3.json new file mode 100644 index 00000000..57546e51 --- /dev/null +++ b/chapter09/docs/09-graph3.json @@ -0,0 +1,19 @@ +{ + "ver": 1, + "comp": "chapter09/docs/09-graph3.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 6, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 7, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter09/docs/09-graph3.svg b/chapter09/docs/09-graph3.svg index f26c96e8..51804b59 100644 --- a/chapter09/docs/09-graph3.svg +++ b/chapter09/docs/09-graph3.svg @@ -1,109 +1,96 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter08 Pages: 1 --> -<svg width="186pt" height="392pt" - viewBox="0.00 0.00 186.00 392.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 388)"> -<title>chapter08</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-388 182,-388 182,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-376 170,-376 170,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="24,-339 24,-364 105,-364 105,-339 24,-339"/> -<polygon fill="none" stroke="black" points="24,-339 24,-364 105,-364 105,-339 24,-339"/> -<text text-anchor="start" x="46" y="-347.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="24,-308 24,-339 105,-339 105,-308 24,-308"/> -<polygon fill="yellow" stroke="transparent" points="29,-313 29,-334 69,-334 69,-313 29,-313"/> -<polygon fill="none" stroke="black" points="29,-313 29,-334 69,-334 69,-313 29,-313"/> -<text text-anchor="start" x="32" y="-319.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="69,-313 69,-334 100,-334 100,-313 69,-313"/> -<text text-anchor="start" x="72" y="-319.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="83,-52 29,-52 29,-16 83,-16 83,-52"/> -<text text-anchor="middle" x="56" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return9 --> -<g id="node6" class="node"> -<title>Return9</title> -<polygon fill="yellow" stroke="black" points="89,-124 23,-124 23,-88 89,-88 89,-124"/> -<text text-anchor="middle" x="56" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return9 --> -<g id="edge1" class="edge"> -<title>Stop3->Return9</title> -<path fill="none" stroke="red" d="M56,-52.3C56,-60.02 56,-69.29 56,-77.89"/> -<polygon fill="red" stroke="red" points="52.5,-77.9 56,-87.9 59.5,-77.9 52.5,-77.9"/> -<text text-anchor="middle" x="53" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Mul6 --> -<g id="node3" class="node"> -<title>Mul6</title> -<ellipse fill="none" stroke="black" cx="63" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-246.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Mul6->Start2 --> -<g id="edge2" class="edge"> -<title>Mul6->Start2:p1</title> -<path fill="none" stroke="black" d="M72.2,-267.01C76.96,-276.47 82.18,-289.06 84.17,-301.8"/> -<polygon fill="black" stroke="black" points="80.7,-302.32 85,-312 87.67,-301.75 80.7,-302.32"/> -<text text-anchor="middle" x="69.2" y="-269.61" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Mul7 --> -<g id="node4" class="node"> -<title>Mul7</title> -<ellipse fill="none" stroke="black" cx="135" cy="-250" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-246.3" font-family="Times,serif" font-size="14.00">*</text> -</g> -<!-- Mul7->Start2 --> -<g id="edge4" class="edge"> -<title>Mul7->Start2:p1</title> -<path fill="none" stroke="black" d="M116.38,-263.15C104.61,-272.17 90.81,-285.67 86.42,-301.7"/> -<polygon fill="black" stroke="black" points="82.9,-301.62 85,-312 89.83,-302.57 82.9,-301.62"/> -<text text-anchor="middle" x="113.38" y="-265.75" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Sub8 --> -<g id="node5" class="node"> -<title>Sub8</title> -<ellipse fill="none" stroke="black" cx="63" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="63" y="-174.3" font-family="Times,serif" font-size="14.00">-</text> -</g> -<!-- Sub8->Mul6 --> -<g id="edge6" class="edge"> -<title>Sub8->Mul6</title> -<path fill="none" stroke="black" d="M63,-196.3C63,-204.02 63,-213.29 63,-221.89"/> -<polygon fill="black" stroke="black" points="59.5,-221.9 63,-231.9 66.5,-221.9 59.5,-221.9"/> -<text text-anchor="middle" x="60" y="-198.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Sub8->Mul7 --> -<g id="edge7" class="edge"> -<title>Sub8->Mul7</title> -<path fill="none" stroke="black" d="M77.57,-193.17C87.75,-203.06 101.52,-216.45 113.03,-227.64"/> -<polygon fill="black" stroke="black" points="110.59,-230.15 120.2,-234.62 115.47,-225.13 110.59,-230.15"/> -<text text-anchor="middle" x="74.57" y="-195.77" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return9->Start2 --> -<g id="edge8" class="edge"> -<title>Return9->Start2:p0</title> -<path fill="none" stroke="red" d="M43.69,-124.22C37.35,-134.16 30.27,-147.2 27,-160 15.11,-206.5 15.97,-221.28 27,-268 31.12,-285.46 43.28,-289.17 47.52,-302.01"/> -<polygon fill="red" stroke="red" points="44.08,-302.62 49,-312 51,-301.6 44.08,-302.62"/> -<text text-anchor="middle" x="40.69" y="-126.82" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return9->Sub8 --> -<g id="edge9" class="edge"> -<title>Return9->Sub8</title> -<path fill="none" stroke="black" d="M57.73,-124.3C58.5,-132.02 59.43,-141.29 60.29,-149.89"/> -<polygon fill="black" stroke="black" points="56.81,-150.29 61.29,-159.9 63.78,-149.6 56.81,-150.29"/> -<text text-anchor="middle" x="54.73" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="391" height="528" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 391 528" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,427 C104,451 195.5,454 195.5,478" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #9 · CTRL</title></path><path class="edge DATA" id="e6i1" d="M204,118 L204,128 L155,128 L155,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#6[1] → #4 · DATA</title></path><path class="edge DATA" id="e6i2" d="M204,118 L204,128 L185,128 L185,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#6[2] → #4 · DATA</title></path><path class="edge DATA" id="e7i1" d="M204,118 L204,128 L307,128 L307,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #4 · DATA</title></path><path class="edge DATA" id="e7i2" d="M204,118 L204,128 L337,128 L337,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[2] → #4 · DATA</title></path><path class="edge DATA" id="e8i1" d="M155,222 L155,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #6 · DATA</title></path><path class="edge DATA" id="e8i2" d="M307,222 L307,232 L185,232 L185,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[2] → #7 · DATA</title></path><path class="edge CTRL" id="e9i0" d="M84,118 L84,374" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #1 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M155,326 L155,336 L124,336 L124,374" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #8 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(159.5,478)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #9 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(144,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n6" data-id="6" transform="translate(95,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 * +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n7" data-id="7" transform="translate(247,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>*</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 * +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n8" data-id="8" transform="translate(95,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 - +Type not computed + +[0] → — DATA +[1] → #6 DATA +[2] → #7 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(44,380)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 Return +Type not computed + +[0] → #1 CTRL +[1] → #8 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter09/docs/09-graph4.json b/chapter09/docs/09-graph4.json new file mode 100644 index 00000000..accad3ff --- /dev/null +++ b/chapter09/docs/09-graph4.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter09/docs/09-graph4.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 9, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 10, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter09/docs/09-graph4.svg b/chapter09/docs/09-graph4.svg index 4eef5414..89045214 100644 --- a/chapter09/docs/09-graph4.svg +++ b/chapter09/docs/09-graph4.svg @@ -1,67 +1,80 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter09 Pages: 1 --> -<svg width="178pt" height="248pt" - viewBox="0.00 0.00 178.00 248.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 244)"> -<title>chapter09</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-244 174,-244 174,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-232 162,-232 162,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="24,-195 24,-220 74,-220 74,-195 24,-195"/> -<polygon fill="none" stroke="black" points="24,-195 24,-220 74,-220 74,-195 24,-195"/> -<text text-anchor="start" x="30.5" y="-203.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="24,-164 24,-195 74,-195 74,-164 24,-164"/> -<polygon fill="yellow" stroke="transparent" points="29,-169 29,-190 69,-190 69,-169 29,-169"/> -<polygon fill="none" stroke="black" points="29,-169 29,-190 69,-190 69,-169 29,-169"/> -<text text-anchor="start" x="32" y="-175.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="112,-52 58,-52 58,-16 112,-16 112,-52"/> -<text text-anchor="middle" x="85" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return10 --> -<g id="node4" class="node"> -<title>Return10</title> -<polygon fill="yellow" stroke="black" points="118,-124 52,-124 52,-88 118,-88 118,-124"/> -<text text-anchor="middle" x="85" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return10 --> -<g id="edge1" class="edge"> -<title>Stop3->Return10</title> -<path fill="none" stroke="red" d="M85,-52.3C85,-60.02 85,-69.29 85,-77.89"/> -<polygon fill="red" stroke="red" points="81.5,-77.9 85,-87.9 88.5,-77.9 81.5,-77.9"/> -<text text-anchor="middle" x="82" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_9 --> -<g id="node3" class="node"> -<title>Con_9</title> -<ellipse fill="none" stroke="black" cx="127" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="127" y="-188.3" font-family="Times,serif" font-size="14.00">#0</text> -</g> -<!-- Return10->Start2 --> -<g id="edge2" class="edge"> -<title>Return10->Start2:p0</title> -<path fill="none" stroke="red" d="M68.26,-124.13C60.77,-133.26 52.99,-145.23 50.13,-158.06"/> -<polygon fill="red" stroke="red" points="46.66,-157.67 49,-168 53.61,-158.46 46.66,-157.67"/> -<text text-anchor="middle" x="65.26" y="-126.73" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return10->Con_9 --> -<g id="edge3" class="edge"> -<title>Return10->Con_9</title> -<path fill="none" stroke="black" d="M93.7,-124.4C99.66,-136.31 107.65,-152.3 114.31,-165.62"/> -<polygon fill="black" stroke="black" points="111.28,-167.38 118.88,-174.76 117.54,-164.25 111.28,-167.38"/> -<text text-anchor="middle" x="90.7" y="-127" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="326" height="320" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 326 320" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #10 · CTRL</title></path><path class="edge CTRL" id="e10i0" d="M84,118 L84,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #1 · CTRL</title></path><path class="edge DATA" id="e10i1" d="M242,118 L242,128 L124,128 L124,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(24,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(127,270)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #10 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n9" data-id="9" transform="translate(182,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 #0 +Type not computed + +</title></g><g class="node" id="n10" data-id="10" transform="translate(44,172)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 Return +Type not computed + +[0] → #1 CTRL +[1] → #9 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter09/docs/09-graph5.json b/chapter09/docs/09-graph5.json new file mode 100644 index 00000000..31957bfa --- /dev/null +++ b/chapter09/docs/09-graph5.json @@ -0,0 +1,27 @@ +{ + "ver": 1, + "comp": "chapter09/docs/09-graph5.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 0}}, + {"id": 6, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 7, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 8, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 1}}, + {"id": 9, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 7, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}, {"idx": 2, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "#10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 18, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 7, "par": 0, "nodes": [5, 7, 8, 9, 10, 12, 16, 18]} + ] +} diff --git a/chapter09/docs/09-graph5.svg b/chapter09/docs/09-graph5.svg index 9d0698db..7457cb38 100644 --- a/chapter09/docs/09-graph5.svg +++ b/chapter09/docs/09-graph5.svg @@ -1,210 +1,124 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter09 Pages: 1 --> -<svg width="338pt" height="492pt" - viewBox="0.00 0.00 338.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)"> -<title>chapter09</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-488 334,-488 334,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-476 322,-476 322,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="153,-439 153,-464 234,-464 234,-439 153,-439"/> -<polygon fill="none" stroke="black" points="153,-439 153,-464 234,-464 234,-439 153,-439"/> -<text text-anchor="start" x="175" y="-447.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="153,-408 153,-439 234,-439 234,-408 153,-408"/> -<polygon fill="yellow" stroke="transparent" points="158,-413 158,-434 198,-434 198,-413 158,-413"/> -<polygon fill="none" stroke="black" points="158,-413 158,-434 198,-434 198,-413 158,-413"/> -<text text-anchor="start" x="161" y="-419.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="198,-413 198,-434 229,-434 229,-413 198,-413"/> -<text text-anchor="start" x="201" y="-419.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="271,-52 217,-52 217,-16 271,-16 271,-52"/> -<text text-anchor="middle" x="244" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return21 --> -<g id="node11" class="node"> -<title>Return21</title> -<polygon fill="yellow" stroke="black" points="277,-124 211,-124 211,-88 277,-88 277,-124"/> -<text text-anchor="middle" x="244" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return21 --> -<g id="edge1" class="edge"> -<title>Stop3->Return21</title> -<path fill="none" stroke="red" d="M244,-52.3C244,-60.02 244,-69.29 244,-77.89"/> -<polygon fill="red" stroke="red" points="240.5,-77.9 244,-87.9 247.5,-77.9 240.5,-77.9"/> -<text text-anchor="middle" x="241" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_6 --> -<g id="node3" class="node"> -<title>Con_6</title> -<ellipse fill="none" stroke="black" cx="43" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-346.3" font-family="Times,serif" font-size="14.00">#1</text> -</g> -<!-- Loop7 --> -<g id="node4" class="node"> -<title>Loop7</title> -<polygon fill="yellow" stroke="black" points="142,-368 88,-368 88,-332 142,-332 142,-368"/> -<text text-anchor="middle" x="115" y="-346.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop7->Start2 --> -<g id="edge2" class="edge"> -<title>Loop7->Start2:p0</title> -<path fill="none" stroke="red" d="M117.35,-368.06C120.75,-386.19 128.75,-413.28 146.69,-420.93"/> -<polygon fill="red" stroke="red" points="146.51,-424.46 157,-423 147.89,-417.6 146.51,-424.46"/> -<text text-anchor="middle" x="114.35" y="-370.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If12 --> -<g id="node8" class="node"> -<title>If12</title> -<polygon fill="yellow" stroke="transparent" points="147,-195 147,-220 241,-220 241,-195 147,-195"/> -<polygon fill="none" stroke="black" points="147,-195 147,-220 241,-220 241,-195 147,-195"/> -<text text-anchor="start" x="188.5" y="-203.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="147,-164 147,-195 241,-195 241,-164 147,-164"/> -<polygon fill="yellow" stroke="transparent" points="152,-169 152,-190 192,-190 192,-169 152,-169"/> -<polygon fill="none" stroke="black" points="152,-169 152,-190 192,-190 192,-169 152,-169"/> -<text text-anchor="start" x="155" y="-175.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="192,-169 192,-190 236,-190 236,-169 192,-169"/> -<polygon fill="none" stroke="black" points="192,-169 192,-190 236,-190 236,-169 192,-169"/> -<text text-anchor="start" x="195" y="-175.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- Loop7->If12 --> -<g id="edge3" class="edge"> -<title>Loop7->If12:p0</title> -<path fill="none" stroke="red" d="M142.11,-336.15C145.11,-334.74 148.12,-333.34 151,-332 186,-315.76 209.13,-328.45 230,-296 238.66,-282.54 239,-273.23 230,-260 205.55,-224.03 163.45,-259.97 139,-224 125.26,-203.78 121.98,-186.54 139,-169 146.02,-161.76 158.99,-157.07 166.4,-159.61"/> -<polygon fill="red" stroke="red" points="163.54,-161.62 172,-168 169.36,-157.74 163.54,-161.62"/> -<text text-anchor="middle" x="145.11" y="-329.75" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg9 --> -<g id="node5" class="node"> -<title>Phi_arg9</title> -<ellipse fill="lightyellow" stroke="black" cx="277" cy="-350" rx="37.09" ry="18"/> -<text text-anchor="middle" x="277" y="-346.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg9->Start2 --> -<g id="edge5" class="edge"> -<title>Phi_arg9->Start2:p1</title> -<path fill="none" stroke="black" d="M273.71,-368.06C269.21,-386.44 259.37,-414.03 239.96,-421.23"/> -<polygon fill="black" stroke="black" points="239.23,-417.81 230,-423 240.46,-424.7 239.23,-417.81"/> -<text text-anchor="middle" x="270.71" y="-370.66" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg9->Loop7 --> -<g id="edge4" class="edge"> -<title>Phi_arg9->Loop7</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M258.53,-334.01C248.46,-326.34 235.34,-317.98 222,-314 195.59,-306.13 186,-304.88 160,-314 152.86,-316.5 146.01,-320.67 139.91,-325.3"/> -<polygon fill="black" stroke="black" points="137.55,-322.71 132.08,-331.78 142.01,-328.1 137.55,-322.71"/> -<text text-anchor="middle" x="255.53" y="-327.61" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add18 --> -<g id="node10" class="node"> -<title>Add18</title> -<ellipse fill="none" stroke="black" cx="66" cy="-192" rx="27" ry="18"/> -<text text-anchor="middle" x="66" y="-188.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Phi_arg9->Add18 --> -<g id="edge6" class="edge"> -<title>Phi_arg9->Add18</title> -<path fill="none" stroke="black" d="M249.01,-337.87C243.12,-335.75 236.9,-333.68 231,-332 153.36,-309.94 104.1,-358.47 53,-296 35.4,-274.49 43.72,-241.53 53.12,-218.71"/> -<polygon fill="black" stroke="black" points="56.43,-219.88 57.28,-209.32 50.03,-217.04 56.43,-219.88"/> -<text text-anchor="middle" x="246.01" y="-331.47" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- LT10 --> -<g id="node6" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="194" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="194" y="-274.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg9 --> -<g id="edge7" class="edge"> -<title>LT10->Phi_arg9</title> -<path fill="none" stroke="black" d="M210.4,-292.83C222.06,-302.66 237.95,-316.07 251.29,-327.31"/> -<polygon fill="black" stroke="black" points="249.3,-330.22 259.2,-333.99 253.81,-324.86 249.3,-330.22"/> -<text text-anchor="middle" x="207.4" y="-295.43" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_11 --> -<g id="node7" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="black" cx="191" cy="-350" rx="30.59" ry="18"/> -<text text-anchor="middle" x="191" y="-346.3" font-family="Times,serif" font-size="14.00">#10</text> -</g> -<!-- LT10->Con_11 --> -<g id="edge8" class="edge"> -<title>LT10->Con_11</title> -<path fill="none" stroke="black" d="M193.26,-296.3C192.93,-304.02 192.53,-313.29 192.16,-321.89"/> -<polygon fill="black" stroke="black" points="188.66,-321.75 191.73,-331.9 195.66,-322.05 188.66,-321.75"/> -<text text-anchor="middle" x="190.26" y="-298.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If12->Loop7 --> -<g id="edge9" class="edge"> -<title>If12->Loop7</title> -<path fill="none" stroke="red" d="M176.87,-224.21C170.8,-235.44 164,-248.24 158,-260 147.34,-280.9 135.81,-304.85 127.37,-322.64"/> -<polygon fill="red" stroke="red" points="124.14,-321.29 123.03,-331.83 130.46,-324.29 124.14,-321.29"/> -<text text-anchor="middle" x="173.87" y="-226.81" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If12->LT10 --> -<g id="edge10" class="edge"> -<title>If12->LT10</title> -<path fill="none" stroke="black" d="M194,-224.28C194,-232.58 194,-241.48 194,-249.56"/> -<polygon fill="black" stroke="black" points="190.5,-249.6 194,-259.6 197.5,-249.6 190.5,-249.6"/> -<text text-anchor="middle" x="191" y="-226.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16 --> -<g id="node9" class="node"> -<title>Add16</title> -<ellipse fill="none" stroke="black" cx="89" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="89" y="-274.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- Add16->Con_6 --> -<g id="edge11" class="edge"> -<title>Add16->Con_6</title> -<path fill="none" stroke="black" d="M78.56,-294.88C72.8,-303.66 65.52,-314.74 59.04,-324.58"/> -<polygon fill="black" stroke="black" points="55.96,-322.9 53.4,-333.18 61.81,-326.74 55.96,-322.9"/> -<text text-anchor="middle" x="75.56" y="-297.48" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add16->Phi_arg9 --> -<g id="edge12" class="edge"> -<title>Add16->Phi_arg9</title> -<path fill="none" stroke="black" d="M112.05,-287.58C143.64,-299.35 200.8,-320.63 238.83,-334.79"/> -<polygon fill="black" stroke="black" points="237.94,-338.19 248.54,-338.4 240.39,-331.63 237.94,-338.19"/> -<text text-anchor="middle" x="115.05" y="-290.18" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add18->Con_6 --> -<g id="edge14" class="edge"> -<title>Add18->Con_6</title> -<path fill="none" stroke="black" d="M62.31,-210.01C59.48,-223.51 55.62,-242.9 53,-260 49.85,-280.62 47.25,-304.07 45.5,-321.72"/> -<polygon fill="black" stroke="black" points="41.99,-321.59 44.51,-331.88 48.96,-322.27 41.99,-321.59"/> -<text text-anchor="middle" x="59.31" y="-212.61" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Add18->Add16 --> -<g id="edge13" class="edge"> -<title>Add18->Add16</title> -<path fill="none" stroke="black" d="M70.65,-210C73.8,-221.5 78.03,-236.93 81.63,-250.08"/> -<polygon fill="black" stroke="black" points="78.34,-251.31 84.35,-260.03 85.09,-249.46 78.34,-251.31"/> -<text text-anchor="middle" x="67.65" y="-212.6" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return21->Phi_arg9 --> -<g id="edge16" class="edge"> -<title>Return21->Phi_arg9</title> -<path fill="none" stroke="black" d="M249.23,-124.03C252.22,-134.35 255.79,-147.83 258,-160 268.31,-216.9 273.41,-284.53 275.6,-321.49"/> -<polygon fill="black" stroke="black" points="272.13,-322.15 276.19,-331.93 279.12,-321.75 272.13,-322.15"/> -<text text-anchor="middle" x="246.23" y="-126.63" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return21->If12 --> -<g id="edge15" class="edge"> -<title>Return21->If12:p1</title> -<path fill="none" stroke="red" d="M230.4,-124.06C224.14,-133.27 217.55,-145.31 215.05,-157.87"/> -<polygon fill="red" stroke="red" points="211.55,-157.69 214,-168 218.51,-158.41 211.55,-157.69"/> -<text text-anchor="middle" x="227.4" y="-126.66" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="668" height="788" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 668 788" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(134,171)"><rect class="region-box" rx="8" width="510" height="410" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M356,687 C356,711 334,714 334,738" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #21 · CTRL</title></path><path class="edge CTRL" id="e7i1" d="M236,118 L236,241" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#7[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e7i2" d="M216,546 L216,556 L632,556 L632,224 L266,224 L266,244" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#7[2] → #5 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M356,118 L356,128 L368,128 L368,241" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M529,502 L529,512 L622,512 L622,232 L408,232 L408,244" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #18 · DATA</title></path><path class="edge DATA" id="e10i1" d="M388,297 L388,307 L316,307 L316,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path><path class="edge DATA" id="e10i2" d="M84,118 L84,128 L165,128 L165,317 L346,317 L346,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #11 · DATA</title></path><path class="edge CTRL" id="e12i0" d="M236,297 L236,449" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #7 · CTRL</title></path><path class="edge DATA" id="e12i1" d="M316,401 L316,449" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #10 · DATA</title></path><path class="edge DATA" id="e16i1" d="M529,118 L529,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #6 · DATA</title></path><path class="edge DATA" id="e16i2" d="M388,297 L388,307 L559,307 L559,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #9 · DATA</title></path><path class="edge DATA" id="e18i1" d="M529,401 L529,449" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #16 · DATA</title></path><path class="edge DATA" id="e18i2" d="M529,118 L529,128 L599,128 L599,411 L559,411 L559,449" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[2] → #6 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M336,549 L336,634" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #8 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M388,297 L388,307 L412,307 L412,596 L376,596 L376,634" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #9 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(298,738)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #21 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(296,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(156,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #12 +Type not computed + +[0] → #12 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(469,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #6</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 #1 +Type not computed + +</title></g><g class="node" id="n7" data-id="7" transform="translate(176,247)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #5 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n8" data-id="8" transform="translate(276,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #8/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 False +Projection 1 of #12 +Type not computed + +[0] → #12 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(328,247)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 φ_arg +Type not computed + +[0] → #7 ASSOC +[1] → #4 DATA +[2] → #18 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #7</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(256,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #9 DATA +[2] → #11 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(24,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#10</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #10 +Type not computed + +</title></g><g class="node" id="n12" data-id="12" transform="translate(156,455)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#12 If +Type not computed + +[0] → #7 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n16" data-id="16" transform="translate(469,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 + +Type not computed + +[0] → — DATA +[1] → #6 DATA +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(469,455)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#18 + +Type not computed + +[0] → — DATA +[1] → #16 DATA +[2] → #6 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n21" data-id="21" transform="translate(296,640)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Return +Type not computed + +[0] → #8 CTRL +[1] → #9 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(134,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #7</tspan></text><title>Loop · 8 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #7"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter09/docs/09-graph6.json b/chapter09/docs/09-graph6.json new file mode 100644 index 00000000..09fa1202 --- /dev/null +++ b/chapter09/docs/09-graph6.json @@ -0,0 +1,26 @@ +{ + "ver": 1, + "comp": "chapter09/docs/09-graph6.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 1}}, + {"id": 7, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 9, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 7, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 25, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}, {"idx": 2, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "#10", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 25, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 7, "par": 0, "nodes": [5, 6, 7, 9, 10, 12, 25]} + ] +} diff --git a/chapter09/docs/09-graph6.svg b/chapter09/docs/09-graph6.svg index 36c70099..2d530c46 100644 --- a/chapter09/docs/09-graph6.svg +++ b/chapter09/docs/09-graph6.svg @@ -1,184 +1,119 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter09 Pages: 1 --> -<svg width="338pt" height="492pt" - viewBox="0.00 0.00 338.00 492.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 488)"> -<title>chapter09</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-488 334,-488 334,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-476 322,-476 322,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="149,-439 149,-464 230,-464 230,-439 149,-439"/> -<polygon fill="none" stroke="black" points="149,-439 149,-464 230,-464 230,-439 149,-439"/> -<text text-anchor="start" x="171" y="-447.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="149,-408 149,-439 230,-439 230,-408 149,-408"/> -<polygon fill="yellow" stroke="transparent" points="154,-413 154,-434 194,-434 194,-413 154,-413"/> -<polygon fill="none" stroke="black" points="154,-413 154,-434 194,-434 194,-413 154,-413"/> -<text text-anchor="start" x="157" y="-419.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="194,-413 194,-434 225,-434 225,-413 194,-413"/> -<text text-anchor="start" x="197" y="-419.8" font-family="Times,serif" font-size="14.00">arg</text> -</g> -<!-- Stop3 --> -<g id="node2" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="157,-52 103,-52 103,-16 157,-16 157,-52"/> -<text text-anchor="middle" x="130" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> -</g> -<!-- Return21 --> -<g id="node8" class="node"> -<title>Return21</title> -<polygon fill="yellow" stroke="black" points="163,-124 97,-124 97,-88 163,-88 163,-124"/> -<text text-anchor="middle" x="130" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return21 --> -<g id="edge1" class="edge"> -<title>Stop3->Return21</title> -<path fill="none" stroke="red" d="M130,-52.3C130,-60.02 130,-69.29 130,-77.89"/> -<polygon fill="red" stroke="red" points="126.5,-77.9 130,-87.9 133.5,-77.9 126.5,-77.9"/> -<text text-anchor="middle" x="127" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Loop7 --> -<g id="node3" class="node"> -<title>Loop7</title> -<polygon fill="yellow" stroke="black" points="314,-368 260,-368 260,-332 314,-332 314,-368"/> -<text text-anchor="middle" x="287" y="-346.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop7->Start2 --> -<g id="edge2" class="edge"> -<title>Loop7->Start2:p0</title> -<path fill="none" stroke="red" d="M259.93,-364.13C234.34,-376.71 197.56,-395.24 181.73,-405.41"/> -<polygon fill="red" stroke="red" points="179.34,-402.85 174,-412 183.88,-408.18 179.34,-402.85"/> -<text text-anchor="middle" x="256.93" y="-357.73" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If12 --> -<g id="node7" class="node"> -<title>If12</title> -<polygon fill="yellow" stroke="transparent" points="36,-195 36,-220 130,-220 130,-195 36,-195"/> -<polygon fill="none" stroke="black" points="36,-195 36,-220 130,-220 130,-195 36,-195"/> -<text text-anchor="start" x="77.5" y="-203.8" font-family="Times,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="36,-164 36,-195 130,-195 130,-164 36,-164"/> -<polygon fill="yellow" stroke="transparent" points="41,-169 41,-190 81,-190 81,-169 41,-169"/> -<polygon fill="none" stroke="black" points="41,-169 41,-190 81,-190 81,-169 41,-169"/> -<text text-anchor="start" x="44" y="-175.8" font-family="Times,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="transparent" points="81,-169 81,-190 125,-190 125,-169 81,-169"/> -<polygon fill="none" stroke="black" points="81,-169 81,-190 125,-190 125,-169 81,-169"/> -<text text-anchor="start" x="84" y="-175.8" font-family="Times,serif" font-size="14.00">False</text> -</g> -<!-- Loop7->If12 --> -<g id="edge3" class="edge"> -<title>Loop7->If12:p0</title> -<path fill="none" stroke="red" d="M259.79,-335.23C256.86,-334.03 253.9,-332.92 251,-332 163.26,-304.1 109.06,-364.01 47,-296 22.33,-268.96 18.57,-203.69 31.46,-184.44"/> -<polygon fill="red" stroke="red" points="33.44,-187.32 40,-179 29.68,-181.42 33.44,-187.32"/> -<text text-anchor="middle" x="256.79" y="-328.83" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg9 --> -<g id="node4" class="node"> -<title>Phi_arg9</title> -<ellipse fill="lightyellow" stroke="black" cx="133" cy="-350" rx="37.09" ry="18"/> -<text text-anchor="middle" x="133" y="-346.3" font-family="Times,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg9->Start2 --> -<g id="edge5" class="edge"> -<title>Phi_arg9->Start2:p1</title> -<path fill="none" stroke="black" d="M162.55,-360.93C181.21,-369 202.84,-382.27 208.56,-401.87"/> -<polygon fill="black" stroke="black" points="205.12,-402.59 210,-412 212.05,-401.61 205.12,-402.59"/> -<text text-anchor="middle" x="159.55" y="-363.53" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg9->Loop7 --> -<g id="edge4" class="edge"> -<title>Phi_arg9->Loop7</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M151.47,-334.01C161.54,-326.34 174.66,-317.98 188,-314 211,-307.14 219.35,-306.06 242,-314 249.14,-316.5 255.99,-320.67 262.09,-325.3"/> -<polygon fill="black" stroke="black" points="259.99,-328.1 269.92,-331.78 264.45,-322.71 259.99,-328.1"/> -<text text-anchor="middle" x="148.47" y="-327.61" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Add25 --> -<g id="node10" class="node"> -<title>Add25</title> -<ellipse fill="none" stroke="black" cx="209" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="209" y="-274.3" font-family="Times,serif" font-size="14.00">+</text> -</g> -<!-- LT10 --> -<g id="node5" class="node"> -<title>LT10</title> -<ellipse fill="none" stroke="black" cx="83" cy="-278" rx="27" ry="18"/> -<text text-anchor="middle" x="83" y="-274.3" font-family="Times,serif" font-size="14.00"><</text> -</g> -<!-- LT10->Phi_arg9 --> -<g id="edge7" class="edge"> -<title>LT10->Phi_arg9</title> -<path fill="none" stroke="black" d="M94.1,-294.54C100.33,-303.26 108.25,-314.35 115.31,-324.24"/> -<polygon fill="black" stroke="black" points="112.58,-326.43 121.24,-332.53 118.27,-322.36 112.58,-326.43"/> -<text text-anchor="middle" x="91.1" y="-297.14" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_11 --> -<g id="node6" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="black" cx="47" cy="-350" rx="30.59" ry="18"/> -<text text-anchor="middle" x="47" y="-346.3" font-family="Times,serif" font-size="14.00">#10</text> -</g> -<!-- LT10->Con_11 --> -<g id="edge8" class="edge"> -<title>LT10->Con_11</title> -<path fill="none" stroke="black" d="M74.65,-295.24C70.35,-303.6 65.01,-313.98 60.17,-323.39"/> -<polygon fill="black" stroke="black" points="57.02,-321.87 55.55,-332.37 63.24,-325.07 57.02,-321.87"/> -<text text-anchor="middle" x="71.65" y="-297.84" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If12->Loop7 --> -<g id="edge9" class="edge"> -<title>If12->Loop7</title> -<path fill="none" stroke="red" d="M138.19,-204.98C172.47,-214.83 215.47,-231.87 245,-260 262.62,-276.78 273.63,-302.43 279.94,-321.89"/> -<polygon fill="red" stroke="red" points="276.66,-323.13 282.89,-331.7 283.36,-321.11 276.66,-323.13"/> -<text text-anchor="middle" x="141.19" y="-198.58" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If12->LT10 --> -<g id="edge10" class="edge"> -<title>If12->LT10</title> -<path fill="none" stroke="black" d="M83,-224.28C83,-232.58 83,-241.48 83,-249.56"/> -<polygon fill="black" stroke="black" points="79.5,-249.6 83,-259.6 86.5,-249.6 79.5,-249.6"/> -<text text-anchor="middle" x="80" y="-226.88" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return21->Phi_arg9 --> -<g id="edge12" class="edge"> -<title>Return21->Phi_arg9</title> -<path fill="none" stroke="black" d="M137.07,-124.33C140.84,-134.53 145.09,-147.78 147,-160 155.96,-217.25 145.96,-285.18 138.86,-322"/> -<polygon fill="black" stroke="black" points="135.39,-321.46 136.86,-331.95 142.26,-322.84 135.39,-321.46"/> -<text text-anchor="middle" x="134.07" y="-126.93" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return21->If12 --> -<g id="edge11" class="edge"> -<title>Return21->If12:p1</title> -<path fill="none" stroke="red" d="M117.92,-124C112.25,-133.3 106.24,-145.44 103.95,-157.94"/> -<polygon fill="red" stroke="red" points="100.46,-157.71 103,-168 107.43,-158.38 100.46,-157.71"/> -<text text-anchor="middle" x="114.92" y="-126.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_24 --> -<g id="node9" class="node"> -<title>Con_24</title> -<ellipse fill="none" stroke="black" cx="215" cy="-350" rx="27" ry="18"/> -<text text-anchor="middle" x="215" y="-346.3" font-family="Times,serif" font-size="14.00">#2</text> -</g> -<!-- Add25->Phi_arg9 --> -<g id="edge13" class="edge"> -<title>Add25->Phi_arg9</title> -<path fill="none" stroke="black" d="M185.95,-300.23C176.82,-308.64 166.31,-318.32 157.07,-326.83"/> -<polygon fill="black" stroke="black" points="188.64,-302.51 193.62,-293.17 183.89,-297.37 188.64,-302.51"/> -<polygon fill="black" stroke="black" points="154.66,-324.29 149.68,-333.64 159.4,-329.44 154.66,-324.29"/> -<text text-anchor="middle" x="190.62" y="-295.77" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Add25->Con_24 --> -<g id="edge14" class="edge"> -<title>Add25->Con_24</title> -<path fill="none" stroke="black" d="M210.48,-296.3C211.14,-304.02 211.94,-313.29 212.68,-321.89"/> -<polygon fill="black" stroke="black" points="209.19,-322.23 213.53,-331.9 216.17,-321.63 209.19,-322.23"/> -<text text-anchor="middle" x="207.48" y="-298.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="841" height="788" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841 788" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="637" height="410" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M246,687 C246,711 420.5,714 420.5,738" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #21 · CTRL</title></path><path class="edge CTRL" id="e7i1" d="M126,118 L126,241" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#7[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e7i2" d="M106,546 L106,556 L649,556 L649,224 L156,224 L156,244" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#7[2] → #5 · CTRL</title></path><path class="edge DATA" id="e9i1" d="M246,118 L246,128 L258,128 L258,241" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[1] → #4 · DATA</title></path><path class="edge DATA" id="e9i2" d="M525,398 L525,408 L639,408 L639,232 L298,232 L298,244" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#9[2] → #25 · DATA</title></path><path class="edge DATA" id="e10i1" d="M278,297 L278,317 L373,317 L373,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[1] → #9 · DATA</title></path><path class="edge DATA" id="e10i2" d="M605,118 L605,307 L403,307 L403,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #11 · DATA</title></path><path class="edge CTRL" id="e12i0" d="M126,297 L126,449" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #7 · CTRL</title></path><path class="edge DATA" id="e12i1" d="M373,401 L373,411 L206,411 L206,449" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[1] → #10 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M226,549 L226,634" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #6 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M278,297 L278,317 L302,317 L302,596 L266,596 L266,634" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #9 · DATA</title></path><path class="edge DATA" id="e25i1" d="M278,297 L278,317 L525,317 L525,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[1] → #9 · DATA</title></path><path class="edge DATA" id="e25i2" d="M757,118 L757,128 L616,128 L616,317 L555,317 L555,345" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[2] → #24 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(66,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(66,24)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(384.5,738)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #21 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(186,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #4/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 arg +Projection 1 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n5" data-id="5" transform="translate(46,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 True +Projection 0 of #12 +Type not computed + +[0] → #12 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(166,499)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 False +Projection 1 of #12 +Type not computed + +[0] → #12 CTRL</title></g><g class="node" id="n7" data-id="7" transform="translate(66,247)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #7</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #5 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n9" data-id="9" transform="translate(218,247)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 φ_arg +Type not computed + +[0] → #7 ASSOC +[1] → #4 DATA +[2] → #25 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #7</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n10" data-id="10" transform="translate(313,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 < +Type not computed + +[0] → — DATA +[1] → #9 DATA +[2] → #11 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n11" data-id="11" transform="translate(545,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#10</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #10 +Type not computed + +</title></g><g class="node" id="n12" data-id="12" transform="translate(46,455)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#12 If +Type not computed + +[0] → #7 CTRL +[1] → #10 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n21" data-id="21" transform="translate(186,640)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Return +Type not computed + +[0] → #6 CTRL +[1] → #9 DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n24" data-id="24" transform="translate(697,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 #2 +Type not computed + +</title></g><g class="node" id="n25" data-id="25" transform="translate(465,351)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>+</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 + +Type not computed + +[0] → — DATA +[1] → #9 DATA +[2] → #24 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #7</tspan></text><title>Loop · 7 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #7"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter09/docs/Makefile b/chapter09/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter09/docs/Makefile +++ b/chapter09/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter10a/README.md b/chapter10a/README.md index 80a1f46c..b9ea258a 100644 --- a/chapter10a/README.md +++ b/chapter10a/README.md @@ -45,7 +45,7 @@ are `{ctrl, $mem, result}`. The memory edge is a dependency, not a copy of the heap. The graph determines the legal execution order. In hardware, a Store updates physical memory -directly. In the evaluator, a Store updates an objects' attached memory array. +directly. In the evaluator, a Store updates an object's attached memory array. ## Memory is an SSA variable @@ -269,7 +269,7 @@ If `bar` is `null` then we would like `!bar` to evaluate to `true`. In the else branch we know `bar` is not null, hence the assignment to `bar.a` should be allowed. -To enable this behaviour, we make following enhancements. +To enable this behaviour, we make the following enhancements. * We track the null-ness of a pointer in the Type system, and hence in every Node that ptr type flows through. @@ -286,7 +286,7 @@ To enable this behaviour, we make following enhancements. * The up-cast is represented by the `CastNode` op, and if applicable, we replace all occurrences of the original predicate with the up-cast in the - current scope. The change is local to each branch of the `If`; occuring + current scope. The change is local to each branch of the `If`; occurring separately for the true and the false branches of the `If` (and the false branch inverts the predicate). @@ -295,7 +295,7 @@ To enable this behaviour, we make following enhancements. and `CastNode`. * When computing a type for Not, we produce an Integer type when its input is a - ptr. When the input is a `null` we convert to `1` and when is a not `null` + ptr. When the input is a `null` we convert to `1` and when it is a non-null ptr value, we convert to `0`. See `NotNode.compute()`. diff --git a/chapter10a/docs/example1.gv b/chapter10a/docs/example1.gv index d399b562..9585b8e4 100644 --- a/chapter10a/docs/example1.gv +++ b/chapter10a/docs/example1.gv @@ -1,10 +1,16 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - M0 [label="Initial memory"]; - X [label="Store p.x = 3"]; - Y [label="Store p.y = arg"]; - L [label="Load p.x"]; - L -> Y -> X -> M0 [color=blue]; - Return -> Y [color=blue]; Return -> L; + + M0 [label="Initial memory" shape=octagon style="filled" fillcolor="#dcecff"]; + X [label="Store p.x = 3" shape=octagon style="filled" fillcolor="#dcecff"]; + Y [label="Store p.y = arg" shape=octagon style="filled" fillcolor="#dcecff"]; + L [label="Load p.x" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + L -> Y -> X -> M0 [color="#2867b2"]; + Return -> Y [color="#2867b2"]; Return -> L; + Return [shape=box style="filled" fillcolor="#fff1c4"]; } diff --git a/chapter10a/docs/example1.svg b/chapter10a/docs/example1.svg index d1c5e3bd..fdb4864c 100644 --- a/chapter10a/docs/example1.svg +++ b/chapter10a/docs/example1.svg @@ -4,70 +4,70 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="556pt" height="67pt" - viewBox="0.00 0.00 555.75 67.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 63)"> +<svg width="650pt" height="72pt" + viewBox="0.00 0.00 650.34 72.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 68)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-63 551.75,-63 551.75,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-68 646.34,-68 646.34,4 -4,4"/> <!-- M0 --> <g id="node1" class="node"> <title>M0</title> -<polygon fill="none" stroke="black" points="98.5,-59 0,-59 0,-23 98.5,-23 98.5,-59"/> -<text text-anchor="middle" x="49.25" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Initial memory</text> +<polygon fill="#dcecff" stroke="#758191" points="124.26,-38.54 124.26,-53.46 87.87,-64 36.4,-64 0,-53.46 0,-38.54 36.4,-28 87.87,-28 124.26,-38.54"/> +<text text-anchor="middle" x="62.13" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Initial memory</text> </g> <!-- X --> <g id="node2" class="node"> <title>X</title> -<polygon fill="none" stroke="black" points="222.5,-59 134.5,-59 134.5,-23 222.5,-23 222.5,-59"/> -<text text-anchor="middle" x="178.5" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Store p.x = 3</text> +<polygon fill="#dcecff" stroke="#758191" points="278.2,-38.54 278.2,-53.46 244.83,-64 197.63,-64 164.26,-53.46 164.26,-38.54 197.63,-28 244.83,-28 278.2,-38.54"/> +<text text-anchor="middle" x="221.23" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store p.x = 3</text> </g> <!-- X->M0 --> <g id="edge3" class="edge"> <title>X->M0</title> -<path fill="none" stroke="blue" d="M134.06,-41C126.33,-41 118.16,-41 110.06,-41"/> -<polygon fill="blue" stroke="blue" points="110.24,-37.5 100.24,-41 110.24,-44.5 110.24,-37.5"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M163.79,-46C163.79,-46 133.87,-46 133.87,-46"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="133.87,-43.55 126.87,-46 133.87,-48.45 133.87,-43.55"/> </g> <!-- Y --> <g id="node3" class="node"> <title>Y</title> -<polygon fill="none" stroke="black" points="357,-59 258.5,-59 258.5,-23 357,-23 357,-59"/> -<text text-anchor="middle" x="307.75" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Store p.y = arg</text> +<polygon fill="#dcecff" stroke="#758191" points="446.59,-38.54 446.59,-53.46 408.98,-64 355.8,-64 318.2,-53.46 318.2,-38.54 355.8,-28 408.98,-28 446.59,-38.54"/> +<text text-anchor="middle" x="382.39" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store p.y = arg</text> </g> <!-- Y->X --> <g id="edge2" class="edge"> <title>Y->X</title> -<path fill="none" stroke="blue" d="M258.28,-41C250.45,-41 242.29,-41 234.32,-41"/> -<polygon fill="blue" stroke="blue" points="234.35,-37.5 224.35,-41 234.35,-44.5 234.35,-37.5"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M317.77,-46C317.77,-46 287.85,-46 287.85,-46"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="287.85,-43.55 280.85,-46 287.85,-48.45 287.85,-43.55"/> </g> <!-- L --> <g id="node4" class="node"> <title>L</title> -<polygon fill="none" stroke="black" points="457.75,-36 393,-36 393,0 457.75,0 457.75,-36"/> -<text text-anchor="middle" x="425.38" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Load p.x</text> +<path fill="#edf3f7" stroke="#758191" d="M536.34,-36C536.34,-36 498.59,-36 498.59,-36 492.59,-36 486.59,-30 486.59,-24 486.59,-24 486.59,-12 486.59,-12 486.59,-6 492.59,0 498.59,0 498.59,0 536.34,0 536.34,0 542.34,0 548.34,-6 548.34,-12 548.34,-12 548.34,-24 548.34,-24 548.34,-30 542.34,-36 536.34,-36"/> +<text text-anchor="middle" x="517.46" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Load p.x</text> </g> <!-- L->Y --> <g id="edge1" class="edge"> <title>L->Y</title> -<path fill="none" stroke="blue" d="M392.78,-24.28C385.16,-25.8 376.76,-27.47 368.31,-29.15"/> -<polygon fill="blue" stroke="blue" points="367.85,-25.68 358.73,-31.06 369.22,-32.54 367.85,-25.68"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M486.13,-32C486.13,-32 434.33,-32 434.33,-32"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="434.33,-29.55 427.33,-32 434.33,-34.45 434.33,-29.55"/> </g> <!-- Return --> <g id="node5" class="node"> <title>Return</title> -<polygon fill="none" stroke="black" points="547.75,-59 493.75,-59 493.75,-23 547.75,-23 547.75,-59"/> -<text text-anchor="middle" x="520.75" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> +<polygon fill="#fff1c4" stroke="#758191" points="642.34,-64 588.34,-64 588.34,-28 642.34,-28 642.34,-64"/> +<text text-anchor="middle" x="615.34" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Return</text> </g> <!-- Return->Y --> <g id="edge4" class="edge"> <title>Return->Y</title> -<path fill="none" stroke="blue" d="M493.52,-43.07C482.49,-43.84 469.5,-44.62 457.75,-45 428.99,-45.93 421.77,-45.68 393,-45 385.14,-44.81 376.87,-44.53 368.71,-44.2"/> -<polygon fill="blue" stroke="blue" points="368.95,-40.7 358.81,-43.76 368.65,-47.7 368.95,-40.7"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M588.16,-50C588.16,-50 455.99,-50 455.99,-50"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="455.99,-47.55 448.99,-50 455.99,-52.45 455.99,-47.55"/> </g> <!-- Return->L --> <g id="edge5" class="edge"> <title>Return->L</title> -<path fill="none" stroke="black" d="M493.74,-34.59C486.17,-32.73 477.69,-30.64 469.38,-28.59"/> -<polygon fill="black" stroke="black" points="470.24,-25.2 459.7,-26.21 468.57,-32 470.24,-25.2"/> +<path fill="none" stroke="#536477" stroke-width="1.5" d="M588.07,-32C588.07,-32 558,-32 558,-32"/> +<polygon fill="#536477" stroke="#536477" stroke-width="1.5" points="558,-29.55 551,-32 558,-34.45 558,-29.55"/> </g> </g> </svg> diff --git a/chapter10a/docs/example2a.gv b/chapter10a/docs/example2a.gv index ec5afbdc..93a8a904 100644 --- a/chapter10a/docs/example2a.gv +++ b/chapter10a/docs/example2a.gv @@ -1,10 +1,17 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - M [label="Incoming memory"]; - A [label="True: Store x"]; - B [label="False: Store y"]; - P [label="Phi(memory)"]; - P -> A -> M [color=blue]; P -> B -> M [color=blue]; - P -> Region [style=dashed]; Return -> P [color=blue]; + + M [label="Incoming memory" shape=octagon style="filled" fillcolor="#dcecff"]; + A [label="True: Store x" shape=octagon style="filled" fillcolor="#dcecff"]; + B [label="False: Store x" shape=octagon style="filled" fillcolor="#dcecff"]; + P [label="Phi(memory)" shape=hexagon style="filled" fillcolor="#f5e4fa"]; + P -> A -> M [color="#2867b2"]; P -> B -> M [color="#2867b2"]; + P -> Region [style=dashed,color="#9396a3"]; Return -> P [color="#2867b2"]; + Return [shape=box style="filled" fillcolor="#fff1c4"]; + Region [shape=trapezium style="filled" fillcolor="#fff1c4"]; } diff --git a/chapter10a/docs/example2a.svg b/chapter10a/docs/example2a.svg index f9a9b4fd..f0bbf531 100644 --- a/chapter10a/docs/example2a.svg +++ b/chapter10a/docs/example2a.svg @@ -4,82 +4,82 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="469pt" height="152pt" - viewBox="0.00 0.00 469.25 152.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 148)"> +<svg width="581pt" height="166pt" + viewBox="0.00 0.00 581.12 166.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 162)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-148 465.25,-148 465.25,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-162 577.12,-162 577.12,4 -4,4"/> <!-- M --> <g id="node1" class="node"> <title>M</title> -<polygon fill="none" stroke="black" points="118.75,-117 0,-117 0,-81 118.75,-81 118.75,-117"/> -<text text-anchor="middle" x="59.38" y="-93.95" font-family="Times New Roman,serif" font-size="14.00">Incoming memory</text> +<polygon fill="#dcecff" stroke="#758191" points="152.14,-101.54 152.14,-116.46 107.58,-127 44.56,-127 0,-116.46 0,-101.54 44.56,-91 107.58,-91 152.14,-101.54"/> +<text text-anchor="middle" x="76.07" y="-104.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Incoming memory</text> </g> <!-- A --> <g id="node2" class="node"> <title>A</title> -<polygon fill="none" stroke="black" points="244.25,-144 156.25,-144 156.25,-108 244.25,-108 244.25,-144"/> -<text text-anchor="middle" x="200.25" y="-120.95" font-family="Times New Roman,serif" font-size="14.00">True: Store x</text> +<polygon fill="#dcecff" stroke="#758191" points="311.24,-132.54 311.24,-147.46 277.57,-158 229.95,-158 196.27,-147.46 196.27,-132.54 229.95,-122 277.57,-122 311.24,-132.54"/> +<text text-anchor="middle" x="253.76" y="-135.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">True: Store x</text> </g> <!-- A->M --> <g id="edge2" class="edge"> <title>A->M</title> -<path fill="none" stroke="blue" d="M156.07,-117.61C147.84,-116.01 139.03,-114.29 130.22,-112.58"/> -<polygon fill="blue" stroke="blue" points="131.06,-109.18 120.58,-110.7 129.72,-116.05 131.06,-109.18"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M272.92,-121.71C272.92,-117.22 272.92,-113.67 272.92,-113.67 272.92,-113.67 161.73,-113.67 161.73,-113.67"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="161.73,-111.22 154.73,-113.67 161.73,-116.12 161.73,-111.22"/> </g> <!-- B --> <g id="node3" class="node"> <title>B</title> -<polygon fill="none" stroke="black" points="245.75,-90 154.75,-90 154.75,-54 245.75,-54 245.75,-90"/> -<text text-anchor="middle" x="200.25" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">False: Store y</text> +<polygon fill="#dcecff" stroke="#758191" points="315.37,-71.54 315.37,-86.46 279.28,-97 228.24,-97 192.14,-86.46 192.14,-71.54 228.24,-61 279.28,-61 315.37,-71.54"/> +<text text-anchor="middle" x="253.76" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">False: Store x</text> </g> <!-- B->M --> <g id="edge4" class="edge"> <title>B->M</title> -<path fill="none" stroke="blue" d="M154.54,-80.69C146.8,-82.2 138.59,-83.79 130.37,-85.39"/> -<polygon fill="blue" stroke="blue" points="129.83,-81.93 120.68,-87.28 131.16,-88.8 129.83,-81.93"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M234.6,-97.29C234.6,-101.78 234.6,-105.33 234.6,-105.33 234.6,-105.33 161.82,-105.33 161.82,-105.33"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="161.82,-102.88 154.82,-105.33 161.82,-107.78 161.82,-102.88"/> </g> <!-- P --> <g id="node4" class="node"> <title>P</title> -<polygon fill="none" stroke="black" points="371.25,-90 281.75,-90 281.75,-54 371.25,-54 371.25,-90"/> -<text text-anchor="middle" x="326.5" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">Phi(memory)</text> +<polygon fill="#f5e4fa" stroke="#758191" points="479.12,-79 448.18,-97 386.31,-97 355.37,-79 386.31,-61 448.18,-61 479.12,-79"/> +<text text-anchor="middle" x="417.25" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Phi(memory)</text> </g> <!-- P->A --> <g id="edge1" class="edge"> <title>P->A</title> -<path fill="none" stroke="blue" d="M283.09,-90.43C273.69,-94.52 263.62,-98.89 253.88,-103.13"/> -<polygon fill="blue" stroke="blue" points="252.64,-99.85 244.86,-107.05 255.43,-106.27 252.64,-99.85"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M417.25,-97.3C417.25,-115.27 417.25,-140 417.25,-140 417.25,-140 320.67,-140 320.67,-140"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="320.67,-137.55 313.67,-140 320.67,-142.45 320.67,-137.55"/> </g> <!-- P->B --> <g id="edge3" class="edge"> <title>P->B</title> -<path fill="none" stroke="blue" d="M281.34,-72C273.66,-72 265.57,-72 257.61,-72"/> -<polygon fill="blue" stroke="blue" points="257.62,-68.5 247.62,-72 257.62,-75.5 257.62,-68.5"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M354.5,-79C354.5,-79 325.06,-79 325.06,-79"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="325.06,-76.55 318.06,-79 325.06,-81.45 325.06,-76.55"/> </g> <!-- Region --> <g id="node5" class="node"> <title>Region</title> -<polygon fill="none" stroke="black" points="227.75,-36 172.75,-36 172.75,0 227.75,0 227.75,-36"/> -<text text-anchor="middle" x="200.25" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Region</text> +<polygon fill="#fff1c4" stroke="#758191" points="282.65,-36 224.86,-36 204.29,0 303.23,0 282.65,-36"/> +<text text-anchor="middle" x="253.76" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Region</text> </g> <!-- P->Region --> <g id="edge5" class="edge"> <title>P->Region</title> -<path fill="none" stroke="black" stroke-dasharray="5,2" d="M283.09,-53.57C268.52,-47.24 252.34,-40.21 238.24,-34.08"/> -<polygon fill="black" stroke="black" points="239.88,-30.97 229.31,-30.2 237.09,-37.39 239.88,-30.97"/> +<path fill="none" stroke="#9396a3" stroke-width="1.5" stroke-dasharray="5,2" d="M417.25,-60.7C417.25,-42.73 417.25,-18 417.25,-18 417.25,-18 302.6,-18 302.6,-18"/> +<polygon fill="#9396a3" stroke="#9396a3" stroke-width="1.5" points="302.6,-15.55 295.6,-18 302.6,-20.45 302.6,-15.55"/> </g> <!-- Return --> <g id="node6" class="node"> <title>Return</title> -<polygon fill="none" stroke="black" points="461.25,-90 407.25,-90 407.25,-54 461.25,-54 461.25,-90"/> -<text text-anchor="middle" x="434.25" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> +<polygon fill="#fff1c4" stroke="#758191" points="573.12,-97 519.12,-97 519.12,-61 573.12,-61 573.12,-97"/> +<text text-anchor="middle" x="546.12" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Return</text> </g> <!-- Return->P --> <g id="edge6" class="edge"> <title>Return->P</title> -<path fill="none" stroke="blue" d="M406.84,-72C399.52,-72 391.29,-72 382.97,-72"/> -<polygon fill="blue" stroke="blue" points="383.17,-68.5 373.17,-72 383.17,-75.5 383.17,-68.5"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M518.79,-79C518.79,-79 489.34,-79 489.34,-79"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="489.34,-76.55 482.34,-79 489.34,-81.45 489.34,-76.55"/> </g> </g> </svg> diff --git a/chapter10a/docs/example2b.gv b/chapter10a/docs/example2b.gv index 3f3309e5..c7d64509 100644 --- a/chapter10a/docs/example2b.gv +++ b/chapter10a/docs/example2b.gv @@ -1,11 +1,19 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - P [label="Phi(memory)"]; - S [label="Loop-body Store"]; - P -> Entry [color=blue]; - P -> S [color=blue,constraint=false]; // Backedge must not place Store before Phi. - S -> P [color=blue]; - P -> Loop [style=dashed]; Return -> P [color=blue]; + + P [label="Phi(memory)" shape=hexagon style="filled" fillcolor="#f5e4fa"]; + S [label="Loop-body Store" shape=octagon style="filled" fillcolor="#dcecff"]; + P -> Entry [color="#2867b2"]; + P -> S [color="#2867b2",constraint=false]; // Backedge must not place Store before Phi. + S -> P [color="#2867b2"]; + P -> Loop [style=dashed,color="#9396a3"]; Return -> P [color="#2867b2"]; Return -> S [style=invis]; // Layout only: Phi, Store, Return from left to right. + Return [shape=box style="filled" fillcolor="#fff1c4"]; + Entry [shape=octagon style="filled" fillcolor="#dcecff"]; + Loop [shape=box style="rounded,filled" fillcolor="#ffe0ab"]; } diff --git a/chapter10a/docs/example2b.svg b/chapter10a/docs/example2b.svg index 8fff33d4..77ebec85 100644 --- a/chapter10a/docs/example2b.svg +++ b/chapter10a/docs/example2b.svg @@ -4,70 +4,70 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="422pt" height="98pt" - viewBox="0.00 0.00 421.75 98.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 94)"> +<svg width="510pt" height="105pt" + viewBox="0.00 0.00 509.87 105.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 101)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-94 417.75,-94 417.75,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-101 505.87,-101 505.87,4 -4,4"/> <!-- P --> <g id="node1" class="node"> <title>P</title> -<polygon fill="none" stroke="black" points="179.5,-63 90,-63 90,-27 179.5,-27 179.5,-63"/> -<text text-anchor="middle" x="134.75" y="-39.95" font-family="Times New Roman,serif" font-size="14.00">Phi(memory)</text> +<polygon fill="#f5e4fa" stroke="#758191" points="223.99,-48 193.05,-66 131.17,-66 100.24,-48 131.17,-30 193.05,-30 223.99,-48"/> +<text text-anchor="middle" x="162.11" y="-43.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Phi(memory)</text> </g> <!-- S --> <g id="node2" class="node"> <title>S</title> -<polygon fill="none" stroke="black" points="323.75,-40 215.5,-40 215.5,-4 323.75,-4 323.75,-40"/> -<text text-anchor="middle" x="269.62" y="-16.95" font-family="Times New Roman,serif" font-size="14.00">Loop-body Store</text> +<polygon fill="#dcecff" stroke="#758191" points="407.87,-12.54 407.87,-27.46 365.73,-38 306.13,-38 263.99,-27.46 263.99,-12.54 306.13,-2 365.73,-2 407.87,-12.54"/> +<text text-anchor="middle" x="335.93" y="-15.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Loop-body Store</text> </g> <!-- P->S --> <g id="edge2" class="edge"> <title>P->S</title> -<path fill="none" stroke="blue" d="M179.67,-43.79C187.52,-42.69 195.84,-41.37 204.12,-39.91"/> -<polygon fill="blue" stroke="blue" points="204.65,-43.37 213.86,-38.13 203.39,-36.49 204.65,-43.37"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M202.86,-35.33C202.86,-35.33 284.35,-35.33 284.35,-35.33"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="284.35,-37.78 291.35,-35.33 284.35,-32.88 284.35,-37.78"/> </g> <!-- Entry --> <g id="node3" class="node"> <title>Entry</title> -<polygon fill="none" stroke="black" points="54,-90 0,-90 0,-54 54,-54 54,-90"/> -<text text-anchor="middle" x="27" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">Entry</text> +<polygon fill="#dcecff" stroke="#758191" points="60.24,-71.54 60.24,-86.46 42.59,-97 17.64,-97 0,-86.46 0,-71.54 17.64,-61 42.59,-61 60.24,-71.54"/> +<text text-anchor="middle" x="30.12" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Entry</text> </g> <!-- P->Entry --> <g id="edge1" class="edge"> <title>P->Entry</title> -<path fill="none" stroke="blue" d="M89.52,-56.29C81.45,-58.35 73.12,-60.48 65.28,-62.48"/> -<polygon fill="blue" stroke="blue" points="64.54,-59.06 55.72,-64.92 66.27,-65.84 64.54,-59.06"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M107.6,-52.67C67.92,-52.67 21.12,-52.67 21.12,-52.67 21.12,-52.67 21.12,-53.47 21.12,-53.47"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="18.67,-51.44 21.12,-58.44 23.57,-51.44 18.67,-51.44"/> </g> <!-- Loop --> <g id="node4" class="node"> <title>Loop</title> -<polygon fill="none" stroke="black" points="54,-36 0,-36 0,0 54,0 54,-36"/> -<text text-anchor="middle" x="27" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Loop</text> +<path fill="#ffe0ab" stroke="#758191" d="M45.12,-36C45.12,-36 15.12,-36 15.12,-36 9.12,-36 3.12,-30 3.12,-24 3.12,-24 3.12,-12 3.12,-12 3.12,-6 9.12,0 15.12,0 15.12,0 45.12,0 45.12,0 51.12,0 57.12,-6 57.12,-12 57.12,-12 57.12,-24 57.12,-24 57.12,-30 51.12,-36 45.12,-36"/> +<text text-anchor="middle" x="30.12" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Loop</text> </g> <!-- P->Loop --> <g id="edge4" class="edge"> <title>P->Loop</title> -<path fill="none" stroke="black" stroke-dasharray="5,2" d="M89.52,-33.71C81.45,-31.65 73.12,-29.52 65.28,-27.52"/> -<polygon fill="black" stroke="black" points="66.27,-24.16 55.72,-25.08 64.54,-30.94 66.27,-24.16"/> +<path fill="none" stroke="#9396a3" stroke-width="1.5" stroke-dasharray="5,2" d="M105.65,-44.33C73.32,-44.33 39.12,-44.33 39.12,-44.33 39.12,-44.33 31.88,-44.33 31.88,-44.33"/> +<polygon fill="#9396a3" stroke="#9396a3" stroke-width="1.5" points="34.74,-44.82 37.6,-37.98 31.1,-41.54 34.74,-44.82"/> </g> <!-- S->P --> <g id="edge3" class="edge"> <title>S->P</title> -<path fill="none" stroke="blue" d="M215.35,-24.59C207.3,-25.84 198.98,-27.27 190.89,-28.79"/> -<polygon fill="blue" stroke="blue" points="190.29,-25.34 181.15,-30.71 191.64,-32.21 190.29,-25.34"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M282.83,-32.67C282.83,-32.67 207.65,-32.67 207.65,-32.67"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="207.65,-30.22 200.65,-32.67 207.65,-35.12 207.65,-30.22"/> </g> <!-- Return --> <g id="node5" class="node"> <title>Return</title> -<polygon fill="none" stroke="black" points="413.75,-63 359.75,-63 359.75,-27 413.75,-27 413.75,-63"/> -<text text-anchor="middle" x="386.75" y="-39.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> +<polygon fill="#fff1c4" stroke="#758191" points="501.87,-66 447.87,-66 447.87,-30 501.87,-30 501.87,-66"/> +<text text-anchor="middle" x="474.87" y="-43.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Return</text> </g> <!-- Return->P --> <g id="edge5" class="edge"> <title>Return->P</title> -<path fill="none" stroke="blue" d="M359.52,-47.07C348.49,-47.84 335.5,-48.62 323.75,-49 275.66,-50.55 263.6,-50.21 215.5,-49 207.59,-48.8 199.24,-48.49 191.04,-48.13"/> -<polygon fill="blue" stroke="blue" points="191.28,-44.64 181.12,-47.67 190.95,-51.63 191.28,-44.64"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M447.39,-52C447.39,-52 227.1,-52 227.1,-52"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="227.1,-49.55 220.1,-52 227.1,-54.45 227.1,-49.55"/> </g> <!-- Return->S --> </g> diff --git a/chapter10a/docs/example2c.gv b/chapter10a/docs/example2c.gv index ef8a5fc8..f3a52b4d 100644 --- a/chapter10a/docs/example2c.gv +++ b/chapter10a/docs/example2c.gv @@ -1,9 +1,14 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - M [label="Prior memory"]; - L [label="Load p.x"]; - S [label="Store p.x"]; - L -> M [color=blue]; S -> M [color=blue]; - S -> L [style=dashed,label="execute load first"]; + + M [label="Prior memory" shape=octagon style="filled" fillcolor="#dcecff"]; + L [label="Load p.x" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + S [label="Store p.x" shape=octagon style="filled" fillcolor="#dcecff"]; + L -> M [color="#2867b2"]; S -> M [color="#2867b2"]; + S -> L [style=dashed,xlabel="execute load first"]; } diff --git a/chapter10a/docs/example2c.svg b/chapter10a/docs/example2c.svg index c7b37912..2aa8fa2d 100644 --- a/chapter10a/docs/example2c.svg +++ b/chapter10a/docs/example2c.svg @@ -4,47 +4,47 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="398pt" height="67pt" - viewBox="0.00 0.00 398.25 67.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 63)"> +<svg width="357pt" height="72pt" + viewBox="0.00 0.00 356.97 72.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 68)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-63 394.25,-63 394.25,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-68 352.97,-68 352.97,4 -4,4"/> <!-- M --> <g id="node1" class="node"> <title>M</title> -<polygon fill="none" stroke="black" points="93.25,-59 0,-59 0,-23 93.25,-23 93.25,-59"/> -<text text-anchor="middle" x="46.62" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Prior memory</text> +<polygon fill="#dcecff" stroke="#758191" points="120.13,-38.54 120.13,-53.46 84.95,-64 35.19,-64 0,-53.46 0,-38.54 35.19,-28 84.95,-28 120.13,-38.54"/> +<text text-anchor="middle" x="60.07" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Prior memory</text> </g> <!-- L --> <g id="node2" class="node"> <title>L</title> -<polygon fill="none" stroke="black" points="195,-36 130.25,-36 130.25,0 195,0 195,-36"/> -<text text-anchor="middle" x="162.62" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Load p.x</text> +<path fill="#edf3f7" stroke="#758191" d="M209.88,-36C209.88,-36 172.13,-36 172.13,-36 166.13,-36 160.13,-30 160.13,-24 160.13,-24 160.13,-12 160.13,-12 160.13,-6 166.13,0 172.13,0 172.13,0 209.88,0 209.88,0 215.88,0 221.88,-6 221.88,-12 221.88,-12 221.88,-24 221.88,-24 221.88,-30 215.88,-36 209.88,-36"/> +<text text-anchor="middle" x="191.01" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Load p.x</text> </g> <!-- L->M --> <g id="edge1" class="edge"> <title>L->M</title> -<path fill="none" stroke="blue" d="M129.87,-24.41C122.08,-25.98 113.51,-27.71 104.92,-29.44"/> -<polygon fill="blue" stroke="blue" points="104.29,-26 95.18,-31.41 105.68,-32.86 104.29,-26"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M159.64,-32C159.64,-32 108.9,-32 108.9,-32"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="108.9,-29.55 101.9,-32 108.9,-34.45 108.9,-29.55"/> </g> <!-- S --> <g id="node3" class="node"> <title>S</title> -<polygon fill="none" stroke="black" points="390.25,-59 324.75,-59 324.75,-23 390.25,-23 390.25,-59"/> -<text text-anchor="middle" x="357.5" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Store p.x</text> +<polygon fill="#dcecff" stroke="#758191" points="348.97,-38.54 348.97,-53.46 323.46,-64 287.39,-64 261.88,-53.46 261.88,-38.54 287.39,-28 323.46,-28 348.97,-38.54"/> +<text text-anchor="middle" x="305.42" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store p.x</text> </g> <!-- S->M --> <g id="edge2" class="edge"> <title>S->M</title> -<path fill="none" stroke="blue" d="M324.5,-47.66C318.62,-48.63 312.52,-49.48 306.75,-50 237.56,-56.21 157.62,-51.66 105.04,-47.07"/> -<polygon fill="blue" stroke="blue" points="105.37,-43.59 95.1,-46.17 104.74,-50.56 105.37,-43.59"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M261.56,-50C261.56,-50 129.87,-50 129.87,-50"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="129.87,-47.55 122.87,-50 129.87,-52.45 129.87,-47.55"/> </g> <!-- S->L --> <g id="edge3" class="edge"> <title>S->L</title> -<path fill="none" stroke="black" stroke-dasharray="5,2" d="M324.41,-35.96C318.54,-35.1 312.47,-34.24 306.75,-33.5 273.09,-29.14 234.87,-25.05 206.4,-22.16"/> -<polygon fill="black" stroke="black" points="207.03,-18.71 196.73,-21.19 206.33,-25.67 207.03,-18.71"/> -<text text-anchor="middle" x="259.88" y="-36.7" font-family="Times New Roman,serif" font-size="14.00">execute load first</text> +<path fill="none" stroke="#536477" stroke-width="1.5" stroke-dasharray="5,2" d="M276.55,-32C276.55,-32 231.55,-32 231.55,-32"/> +<polygon fill="#536477" stroke="#536477" stroke-width="1.5" points="231.55,-29.55 224.55,-32 231.55,-34.45 231.55,-29.55"/> +<text text-anchor="middle" x="219.55" y="-33.95" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">execute load first</text> </g> </g> </svg> diff --git a/chapter10a/docs/lattice.gv b/chapter10a/docs/lattice.gv index 733a5287..eb4d7fb1 100644 --- a/chapter10a/docs/lattice.gv +++ b/chapter10a/docs/lattice.gv @@ -69,7 +69,7 @@ digraph Lattice { STRUCT_BOT [label="⊥:struct\n[struct bottom]"]; STRUCT_PERSON [label="Person\nage: int", shape=box]; STRUCT_S1 [label="s1\nx: int", shape=box]; - STRUCT_S2 [label="s2\nx: int, y: *s1", shape=box]; + STRUCT_S2 [label="s2\nx: int, y: int", shape=box]; STRUCT_MORE [label="…", shape=box]; {rank=same; STRUCT_PERSON; STRUCT_S1; STRUCT_S2; STRUCT_MORE;} STRUCT_PERSON -> STRUCT_S1 -> STRUCT_S2 -> STRUCT_MORE [style=invis]; diff --git a/chapter10a/docs/lattice.svg b/chapter10a/docs/lattice.svg index 24c0de8c..c8bed535 100644 --- a/chapter10a/docs/lattice.svg +++ b/chapter10a/docs/lattice.svg @@ -4,122 +4,122 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Lattice Pages: 1 --> -<svg width="1647pt" height="555pt" - viewBox="0.00 0.00 1647.00 555.43" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 551.43)"> +<svg width="1647pt" height="533pt" + viewBox="0.00 0.00 1647.00 533.45" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 529.45)"> <title>Lattice</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-551.43 1643,-551.43 1643,4 -4,4"/> +<polygon fill="white" stroke="none" points="-4,4 -4,-529.45 1643,-529.45 1643,4 -4,4"/> <g id="clust1" class="cluster"> <title>cluster_control</title> -<polygon fill="none" stroke="#cccccc" points="8,-85.99 8,-476.69 98,-476.69 98,-85.99 8,-85.99"/> -<text text-anchor="middle" x="53" y="-459.39" font-family="Arial" font-size="14.00">Control</text> +<polygon fill="none" stroke="#cccccc" points="8,-85.99 8,-454.71 98,-454.71 98,-85.99 8,-85.99"/> +<text text-anchor="middle" x="53" y="-437.41" font-family="Arial" font-size="14.00">Control</text> </g> <g id="clust2" class="cluster"> <title>cluster_integer</title> -<polygon fill="none" stroke="#cccccc" points="106,-85.99 106,-476.69 404,-476.69 404,-85.99 106,-85.99"/> -<text text-anchor="middle" x="255" y="-459.39" font-family="Arial" font-size="14.00">Integer</text> +<polygon fill="none" stroke="#cccccc" points="106,-85.99 106,-454.71 404,-454.71 404,-85.99 106,-85.99"/> +<text text-anchor="middle" x="255" y="-437.41" font-family="Arial" font-size="14.00">Integer</text> </g> <g id="clust6" class="cluster"> <title>cluster_pointer</title> -<polygon fill="none" stroke="#cccccc" points="412,-75 412,-487.68 893,-487.68 893,-75 412,-75"/> -<text text-anchor="middle" x="652.5" y="-470.38" font-family="Arial" font-size="14.00">Pointer = nullability × struct type</text> +<polygon fill="none" stroke="#cccccc" points="412,-75 412,-465.7 893,-465.7 893,-75 412,-75"/> +<text text-anchor="middle" x="652.5" y="-448.4" font-family="Arial" font-size="14.00">Pointer = nullability × struct type</text> </g> <g id="clust13" class="cluster"> <title>cluster_struct</title> -<polygon fill="none" stroke="#cccccc" points="901,-75 901,-503.43 1233,-503.43 1233,-75 901,-75"/> -<text text-anchor="middle" x="1067" y="-486.13" font-family="Arial" font-size="14.00">Struct</text> -<text text-anchor="middle" x="1067" y="-470.38" font-family="Arial" font-size="14.00">named collection of named scalar types</text> +<polygon fill="none" stroke="#cccccc" points="901,-75 901,-481.45 1233,-481.45 1233,-75 901,-75"/> +<text text-anchor="middle" x="1067" y="-464.15" font-family="Arial" font-size="14.00">Struct</text> +<text text-anchor="middle" x="1067" y="-448.4" font-family="Arial" font-size="14.00">named collection of named scalar types</text> </g> <g id="clust17" class="cluster"> <title>cluster_memory</title> -<polygon fill="none" stroke="#cccccc" points="1241,-85.99 1241,-476.69 1347,-476.69 1347,-85.99 1241,-85.99"/> -<text text-anchor="middle" x="1294" y="-459.39" font-family="Arial" font-size="14.00">Memory</text> +<polygon fill="none" stroke="#cccccc" points="1241,-85.99 1241,-454.71 1347,-454.71 1347,-85.99 1241,-85.99"/> +<text text-anchor="middle" x="1294" y="-437.41" font-family="Arial" font-size="14.00">Memory</text> </g> <g id="clust18" class="cluster"> <title>cluster_tuple</title> -<polygon fill="none" stroke="#cccccc" points="1355,-85.99 1355,-492.44 1631,-492.44 1631,-85.99 1355,-85.99"/> -<text text-anchor="middle" x="1493" y="-475.14" font-family="Arial" font-size="14.00">Tuple</text> -<text text-anchor="middle" x="1493" y="-459.39" font-family="Arial" font-size="14.00">collection of types</text> +<polygon fill="none" stroke="#cccccc" points="1355,-85.99 1355,-470.46 1631,-470.46 1631,-85.99 1355,-85.99"/> +<text text-anchor="middle" x="1493" y="-453.16" font-family="Arial" font-size="14.00">Tuple</text> +<text text-anchor="middle" x="1493" y="-437.41" font-family="Arial" font-size="14.00">collection of types</text> </g> <!-- TOP --> <g id="node1" class="node"> <title>TOP</title> -<ellipse fill="black" stroke="black" cx="845" cy="-529.43" rx="27" ry="18"/> -<text text-anchor="middle" x="845" y="-525.33" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤</text> +<ellipse fill="black" stroke="black" cx="875" cy="-507.45" rx="27" ry="18"/> +<text text-anchor="middle" x="875" y="-503.35" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤</text> </g> <!-- XCTRL --> <g id="node3" class="node"> <title>XCTRL</title> -<ellipse fill="#ffff00" stroke="black" cx="53" cy="-426.94" rx="36.51" ry="18"/> -<text text-anchor="middle" x="53" y="-422.84" font-family="DejaVu Sans" font-size="13.00">⊤:ctrl</text> +<ellipse fill="#ffff00" stroke="black" cx="53" cy="-404.96" rx="36.51" ry="18"/> +<text text-anchor="middle" x="53" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:ctrl</text> </g> <!-- TOP->XCTRL --> <g id="edge53" class="edge"> <title>TOP->XCTRL</title> -<path fill="none" stroke="#555555" d="M817.66,-528.22C687.28,-527.11 133.71,-521.35 102,-503.43 82.18,-492.23 69.06,-469.34 61.42,-451.68"/> -<polygon fill="#555555" stroke="#555555" points="63.46,-451.12 59.24,-446.37 59.57,-452.72 63.46,-451.12"/> +<path fill="none" stroke="#555555" d="M847.89,-506.27C714.74,-505.32 135.11,-500.13 102,-481.45 82.18,-470.26 69.05,-447.37 61.41,-429.71"/> +<polygon fill="#555555" stroke="#555555" points="63.45,-429.15 59.24,-424.39 59.57,-430.74 63.45,-429.15"/> </g> <!-- INT_TOP --> <g id="node5" class="node"> <title>INT_TOP</title> -<ellipse fill="#add8e6" stroke="black" cx="353" cy="-426.94" rx="33.44" ry="18"/> -<text text-anchor="middle" x="353" y="-422.84" font-family="DejaVu Sans" font-size="13.00">⊤:int</text> +<ellipse fill="#add8e6" stroke="black" cx="353" cy="-404.96" rx="33.44" ry="18"/> +<text text-anchor="middle" x="353" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:int</text> </g> <!-- TOP->INT_TOP --> <g id="edge54" class="edge"> <title>TOP->INT_TOP</title> -<path fill="none" stroke="#555555" d="M817.72,-528.22C727.72,-527.33 443.86,-522.98 408,-503.43 387.26,-492.12 372.32,-469.24 363.29,-451.62"/> -<polygon fill="#555555" stroke="#555555" points="365.2,-450.74 360.67,-446.28 361.42,-452.59 365.2,-450.74"/> +<path fill="none" stroke="#555555" d="M847.84,-506.34C753.92,-505.8 446.62,-502.41 408,-481.45 387.24,-470.18 372.3,-447.29 363.27,-429.66"/> +<polygon fill="#555555" stroke="#555555" points="365.18,-428.78 360.66,-424.31 361.41,-430.63 365.18,-428.78"/> </g> <!-- PTR_TOP --> <g id="node10" class="node"> <title>PTR_TOP</title> -<ellipse fill="#008000" stroke="black" cx="685" cy="-426.94" rx="61.7" ry="28.99"/> -<text text-anchor="middle" x="685" y="-431.09" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:ptr</text> -<text text-anchor="middle" x="685" y="-414.59" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊤:struct]</text> +<ellipse fill="#008000" stroke="black" cx="715" cy="-404.96" rx="61.7" ry="28.99"/> +<text text-anchor="middle" x="715" y="-409.11" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:ptr</text> +<text text-anchor="middle" x="715" y="-392.61" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊤:struct]</text> </g> <!-- TOP->PTR_TOP --> <g id="edge55" class="edge"> <title>TOP->PTR_TOP</title> -<path fill="none" stroke="#555555" d="M825.7,-516.31C801.54,-501.14 759.48,-474.72 727.62,-454.71"/> -<polygon fill="#555555" stroke="#555555" points="728.87,-453.01 722.67,-451.6 726.64,-456.57 728.87,-453.01"/> +<path fill="none" stroke="#555555" d="M855.7,-494.33C831.54,-479.16 789.48,-452.73 757.62,-432.72"/> +<polygon fill="#555555" stroke="#555555" points="758.87,-431.03 752.67,-429.62 756.64,-434.59 758.87,-431.03"/> </g> <!-- STRUCT_TOP --> <g id="node20" class="node"> <title>STRUCT_TOP</title> -<ellipse fill="#90ee90" stroke="black" cx="996" cy="-426.94" rx="64.35" ry="28.99"/> -<text text-anchor="middle" x="996" y="-431.09" font-family="DejaVu Sans" font-size="13.00">⊤:struct</text> -<text text-anchor="middle" x="996" y="-414.59" font-family="DejaVu Sans" font-size="13.00">[struct top]</text> +<ellipse fill="#90ee90" stroke="black" cx="996" cy="-404.96" rx="64.35" ry="28.99"/> +<text text-anchor="middle" x="996" y="-409.11" font-family="DejaVu Sans" font-size="13.00">⊤:struct</text> +<text text-anchor="middle" x="996" y="-392.61" font-family="DejaVu Sans" font-size="13.00">[struct top]</text> </g> <!-- TOP->STRUCT_TOP --> <g id="edge56" class="edge"> <title>TOP->STRUCT_TOP</title> -<path fill="none" stroke="#555555" d="M867.28,-518.93C876.68,-514.61 887.61,-509.19 897,-503.43 919.21,-489.82 942.45,-472.29 960.83,-457.55"/> -<polygon fill="#555555" stroke="#555555" points="961.85,-459.43 965.2,-454.02 959.21,-456.16 961.85,-459.43"/> +<path fill="none" stroke="#555555" d="M891.32,-492.9C908.92,-478.28 937.5,-454.55 960.35,-435.57"/> +<polygon fill="#555555" stroke="#555555" points="961.58,-437.27 964.86,-431.82 958.9,-434.04 961.58,-437.27"/> </g> <!-- MEM_TOP --> <g id="node26" class="node"> <title>MEM_TOP</title> -<ellipse fill="#00008b" stroke="black" cx="1294" cy="-426.94" rx="44.7" ry="18"/> -<text text-anchor="middle" x="1294" y="-422.84" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:mem</text> +<ellipse fill="#00008b" stroke="black" cx="1294" cy="-404.96" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1294" y="-400.86" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:mem</text> </g> <!-- TOP->MEM_TOP --> <g id="edge57" class="edge"> <title>TOP->MEM_TOP</title> -<path fill="none" stroke="#555555" d="M872.35,-528C956.06,-526.49 1205.1,-520.6 1237,-503.43 1258.25,-491.99 1273.89,-468.81 1283.35,-451.14"/> -<polygon fill="#555555" stroke="#555555" points="1284.99,-452.55 1285.86,-446.25 1281.25,-450.62 1284.99,-452.55"/> +<path fill="none" stroke="#555555" d="M902.2,-505.86C981.35,-503.98 1207.82,-497.26 1237,-481.45 1258.22,-469.95 1273.86,-446.78 1283.33,-429.12"/> +<polygon fill="#555555" stroke="#555555" points="1284.97,-430.54 1285.85,-424.24 1281.23,-428.61 1284.97,-430.54"/> </g> <!-- TUPLE_TOP --> <g id="node28" class="node"> <title>TUPLE_TOP</title> -<ellipse fill="#ffc0cb" stroke="black" cx="1408" cy="-426.94" rx="44.7" ry="18"/> -<text text-anchor="middle" x="1408" y="-422.84" font-family="DejaVu Sans" font-size="13.00">⊤:tuple</text> +<ellipse fill="#ffc0cb" stroke="black" cx="1408" cy="-404.96" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1408" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:tuple</text> </g> <!-- TOP->TUPLE_TOP --> <g id="edge58" class="edge"> <title>TOP->TUPLE_TOP</title> -<path fill="none" stroke="#555555" d="M872.34,-528.42C971.49,-528.22 1308.63,-525.85 1351,-503.43 1372.33,-492.14 1387.95,-468.94 1397.39,-451.22"/> -<polygon fill="#555555" stroke="#555555" points="1399.04,-452.62 1399.9,-446.32 1395.3,-450.7 1399.04,-452.62"/> +<path fill="none" stroke="#555555" d="M902.34,-506.35C997.63,-505.82 1311.4,-502.48 1351,-481.45 1372.31,-470.13 1387.94,-446.93 1397.39,-429.22"/> +<polygon fill="#555555" stroke="#555555" points="1399.03,-430.62 1399.89,-424.32 1395.29,-428.7 1399.03,-430.62"/> </g> <!-- BOT --> <g id="node2" class="node"> @@ -136,8 +136,8 @@ <!-- XCTRL->CTRL --> <g id="edge1" class="edge"> <title>XCTRL->CTRL</title> -<path fill="none" stroke="#555555" d="M53,-408.67C53,-356.2 53,-198.53 53,-137.49"/> -<polygon fill="#555555" stroke="#555555" points="55.1,-137.72 53,-131.72 50.9,-137.72 55.1,-137.72"/> +<path fill="none" stroke="#555555" d="M53,-386.63C53,-337.1 53,-194.83 53,-137.43"/> +<polygon fill="#555555" stroke="#555555" points="55.1,-137.74 53,-131.74 50.9,-137.74 55.1,-137.74"/> </g> <!-- XCTRL->INT_TOP --> <!-- CTRL->BOT --> @@ -155,8 +155,8 @@ <!-- INT_TOP->INT_NEG --> <g id="edge4" class="edge"> <title>INT_TOP->INT_NEG</title> -<path fill="none" stroke="#555555" d="M339.17,-410.31C306.78,-373.7 225.91,-282.29 188.52,-240.04"/> -<polygon fill="#555555" stroke="#555555" points="190.31,-238.89 184.76,-235.78 187.16,-241.67 190.31,-238.89"/> +<path fill="none" stroke="#555555" d="M337.94,-388.74C305.38,-355.83 228.33,-277.94 190.59,-239.8"/> +<polygon fill="#555555" stroke="#555555" points="192.09,-238.33 186.38,-235.54 189.11,-241.28 192.09,-238.33"/> </g> <!-- INT_ZERO --> <g id="node8" class="node"> @@ -167,8 +167,8 @@ <!-- INT_TOP->INT_ZERO --> <g id="edge5" class="edge"> <title>INT_TOP->INT_ZERO</title> -<path fill="none" stroke="#555555" d="M345.96,-408.92C330.64,-371.87 294.24,-283.85 276.74,-241.52"/> -<polygon fill="#555555" stroke="#555555" points="278.71,-240.79 274.47,-236.05 274.83,-242.39 278.71,-240.79"/> +<path fill="none" stroke="#555555" d="M345.22,-387.12C329.8,-353.79 295.37,-279.32 277.78,-241.29"/> +<polygon fill="#555555" stroke="#555555" points="279.76,-240.57 275.34,-236.01 275.95,-242.34 279.76,-240.57"/> </g> <!-- INT_POS --> <g id="node9" class="node"> @@ -179,8 +179,8 @@ <!-- INT_TOP->INT_POS --> <g id="edge6" class="edge"> <title>INT_TOP->INT_POS</title> -<path fill="none" stroke="#555555" d="M353,-408.57C353,-371.71 353,-285.59 353,-242.89"/> -<polygon fill="#555555" stroke="#555555" points="355.1,-242.96 353,-236.96 350.9,-242.96 355.1,-242.96"/> +<path fill="none" stroke="#555555" d="M353,-386.46C353,-353.14 353,-280.53 353,-242.43"/> +<polygon fill="#555555" stroke="#555555" points="355.1,-242.8 353,-236.8 350.9,-242.8 355.1,-242.8"/> </g> <!-- INT_TOP->PTR_TOP --> <!-- INT_BOT --> @@ -218,51 +218,50 @@ <!-- PTR_NULL --> <g id="node12" class="node"> <title>PTR_NULL</title> -<ellipse fill="#008000" stroke="black" cx="808" cy="-321.96" rx="66.47" ry="28.99"/> -<text text-anchor="middle" x="808" y="-326.11" font-family="DejaVu Sans" font-size="13.00" fill="white">null</text> -<text text-anchor="middle" x="808" y="-309.61" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊤:struct?]</text> +<ellipse fill="#008000" stroke="black" cx="799" cy="-310.97" rx="27.3" ry="18"/> +<text text-anchor="middle" x="799" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">null</text> </g> <!-- PTR_TOP->PTR_NULL --> <g id="edge16" class="edge"> <title>PTR_TOP->PTR_NULL</title> -<path fill="none" stroke="#555555" d="M714.46,-401.27C731.85,-386.71 753.98,-368.18 772.35,-352.8"/> -<polygon fill="#555555" stroke="#555555" points="773.51,-354.57 776.76,-349.11 770.82,-351.35 773.51,-354.57"/> +<path fill="none" stroke="#555555" d="M738.85,-377.84C752,-363.43 768.1,-345.8 780.33,-332.41"/> +<polygon fill="#555555" stroke="#555555" points="781.8,-333.91 784.3,-328.06 778.7,-331.08 781.8,-333.91"/> </g> <!-- PTR_PERSON --> <g id="node14" class="node"> <title>PTR_PERSON</title> -<ellipse fill="#008000" stroke="black" cx="512" cy="-321.96" rx="45.72" ry="18"/> -<text text-anchor="middle" x="512" y="-317.86" font-family="DejaVu Sans" font-size="13.00" fill="white">*Person</text> +<ellipse fill="#008000" stroke="black" cx="542" cy="-310.97" rx="45.72" ry="18"/> +<text text-anchor="middle" x="542" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*Person</text> </g> <!-- PTR_TOP->PTR_PERSON --> <g id="edge17" class="edge"> <title>PTR_TOP->PTR_PERSON</title> -<path fill="none" stroke="#555555" d="M647.46,-403.59C616.14,-384.95 572.05,-358.7 542.78,-341.28"/> -<polygon fill="#555555" stroke="#555555" points="543.94,-339.52 537.71,-338.26 541.79,-343.13 543.94,-339.52"/> +<path fill="none" stroke="#555555" d="M674.88,-382.62C644.57,-366.5 603.47,-344.65 575.04,-329.54"/> +<polygon fill="#555555" stroke="#555555" points="576.08,-327.71 569.8,-326.75 574.11,-331.42 576.08,-327.71"/> </g> <!-- PTR_S1 --> <g id="node15" class="node"> <title>PTR_S1</title> -<ellipse fill="#008000" stroke="black" cx="601" cy="-321.96" rx="27" ry="18"/> -<text text-anchor="middle" x="601" y="-317.86" font-family="DejaVu Sans" font-size="13.00" fill="white">*s1</text> +<ellipse fill="#008000" stroke="black" cx="631" cy="-310.97" rx="27" ry="18"/> +<text text-anchor="middle" x="631" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*s1</text> </g> <!-- PTR_TOP->PTR_S1 --> <g id="edge18" class="edge"> <title>PTR_TOP->PTR_S1</title> -<path fill="none" stroke="#555555" d="M663.37,-399.42C649.25,-382.12 631.09,-359.85 618.01,-343.81"/> -<polygon fill="#555555" stroke="#555555" points="619.81,-342.7 614.39,-339.38 616.56,-345.36 619.81,-342.7"/> +<path fill="none" stroke="#555555" d="M691.15,-377.84C678,-363.43 661.9,-345.8 649.67,-332.41"/> +<polygon fill="#555555" stroke="#555555" points="651.3,-331.08 645.7,-328.06 648.2,-333.91 651.3,-331.08"/> </g> <!-- PTR_MORE --> <g id="node16" class="node"> <title>PTR_MORE</title> -<ellipse fill="#008000" stroke="black" cx="685" cy="-321.96" rx="40.6" ry="18"/> -<text text-anchor="middle" x="685" y="-317.86" font-family="DejaVu Sans" font-size="13.00" fill="white">*s2, …</text> +<ellipse fill="#008000" stroke="black" cx="715" cy="-310.97" rx="40.6" ry="18"/> +<text text-anchor="middle" x="715" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*s2, …</text> </g> <!-- PTR_TOP->PTR_MORE --> <g id="edge19" class="edge"> <title>PTR_TOP->PTR_MORE</title> -<path fill="none" stroke="#555555" d="M685,-397.53C685,-381.91 685,-362.73 685,-347.73"/> -<polygon fill="#555555" stroke="#555555" points="687.1,-347.82 685,-341.82 682.9,-347.82 687.1,-347.82"/> +<path fill="none" stroke="#555555" d="M715,-375.61C715,-363.22 715,-348.82 715,-336.86"/> +<polygon fill="#555555" stroke="#555555" points="717.1,-336.91 715,-330.91 712.9,-336.91 717.1,-336.91"/> </g> <!-- PTR_TOP->STRUCT_TOP --> <!-- PTR_BOT --> @@ -287,8 +286,8 @@ <!-- PTR_NULL->PTR_PERSON_NIL --> <g id="edge26" class="edge"> <title>PTR_NULL->PTR_PERSON_NIL</title> -<path fill="none" stroke="#555555" d="M771.98,-297.33C744.16,-279.08 706.14,-254.14 680.2,-237.12"/> -<polygon fill="#555555" stroke="#555555" points="681.63,-235.56 675.47,-234.02 679.33,-239.07 681.63,-235.56"/> +<path fill="none" stroke="#555555" d="M779.65,-297.94C754.63,-282.39 710.79,-255.14 681.32,-236.82"/> +<polygon fill="#555555" stroke="#555555" points="682.76,-235.24 676.55,-233.86 680.54,-238.81 682.76,-235.24"/> </g> <!-- PTR_S1_NIL --> <g id="node18" class="node"> @@ -299,8 +298,8 @@ <!-- PTR_NULL->PTR_S1_NIL --> <g id="edge27" class="edge"> <title>PTR_NULL->PTR_S1_NIL</title> -<path fill="none" stroke="#555555" d="M791.92,-293.36C782.32,-276.89 770.28,-256.22 761.24,-240.69"/> -<polygon fill="#555555" stroke="#555555" points="763.16,-239.82 758.32,-235.69 759.53,-241.93 763.16,-239.82"/> +<path fill="none" stroke="#555555" d="M789.88,-293.52C781.74,-278.83 769.73,-257.16 760.65,-240.8"/> +<polygon fill="#555555" stroke="#555555" points="762.69,-240.14 757.94,-235.91 759.02,-242.18 762.69,-240.14"/> </g> <!-- PTR_MORE_NIL --> <g id="node19" class="node"> @@ -311,8 +310,8 @@ <!-- PTR_NULL->PTR_MORE_NIL --> <g id="edge28" class="edge"> <title>PTR_NULL->PTR_MORE_NIL</title> -<path fill="none" stroke="#555555" d="M816.74,-292.82C821.67,-276.95 827.77,-257.33 832.48,-242.16"/> -<polygon fill="#555555" stroke="#555555" points="834.45,-242.91 834.23,-236.56 830.44,-241.66 834.45,-242.91"/> +<path fill="none" stroke="#555555" d="M806.33,-293.52C812.78,-279.05 822.24,-257.81 829.5,-241.54"/> +<polygon fill="#555555" stroke="#555555" points="831.32,-242.62 831.84,-236.28 827.48,-240.91 831.32,-242.62"/> </g> <!-- PTR_ANY --> <g id="node13" class="node"> @@ -331,41 +330,41 @@ <!-- PTR_PERSON->PTR_ANY --> <g id="edge20" class="edge"> <title>PTR_PERSON->PTR_ANY</title> -<path fill="none" stroke="#555555" d="M510.3,-303.49C508.98,-289.83 507.09,-270.39 505.45,-253.5"/> -<polygon fill="#555555" stroke="#555555" points="507.58,-253.71 504.91,-247.94 503.4,-254.12 507.58,-253.71"/> +<path fill="none" stroke="#555555" d="M534.66,-293.09C529.74,-281.77 523.08,-266.45 517.05,-252.6"/> +<polygon fill="#555555" stroke="#555555" points="519.08,-251.99 514.76,-247.33 515.23,-253.67 519.08,-251.99"/> </g> <!-- PTR_PERSON->PTR_S1 --> <!-- PTR_PERSON->PTR_PERSON_NIL --> <g id="edge23" class="edge"> <title>PTR_PERSON->PTR_PERSON_NIL</title> -<path fill="none" stroke="#555555" d="M532.81,-305.54C557.17,-287.49 597.57,-257.56 624.25,-237.8"/> -<polygon fill="#555555" stroke="#555555" points="625.26,-239.66 628.83,-234.4 622.76,-236.28 625.26,-239.66"/> +<path fill="none" stroke="#555555" d="M560.49,-294.36C578.62,-279.06 606.38,-255.63 626.38,-238.76"/> +<polygon fill="#555555" stroke="#555555" points="627.67,-240.42 630.9,-234.94 624.96,-237.21 627.67,-240.42"/> </g> <!-- PTR_S1->PTR_ANY --> <g id="edge21" class="edge"> <title>PTR_S1->PTR_ANY</title> -<path fill="none" stroke="#555555" d="M586.82,-306.2C572.74,-291.56 550.72,-268.65 532.64,-249.85"/> -<polygon fill="#555555" stroke="#555555" points="534.38,-248.62 528.7,-245.75 531.35,-251.53 534.38,-248.62"/> +<path fill="none" stroke="#555555" d="M613.06,-297.17C595.19,-284.43 567.11,-264.41 543.66,-247.68"/> +<polygon fill="#555555" stroke="#555555" points="545.14,-246.16 539.04,-244.39 542.7,-249.58 545.14,-246.16"/> </g> <!-- PTR_S1->PTR_MORE --> <!-- PTR_S1->PTR_S1_NIL --> <g id="edge24" class="edge"> <title>PTR_S1->PTR_S1_NIL</title> -<path fill="none" stroke="#555555" d="M617.46,-307.22C623.23,-302.56 629.81,-297.42 636,-292.97 667.33,-270.44 677.09,-267.67 709,-245.97 713.75,-242.74 718.77,-239.22 723.56,-235.8"/> -<polygon fill="#555555" stroke="#555555" points="724.61,-237.64 728.26,-232.43 722.16,-234.22 724.61,-237.64"/> +<path fill="none" stroke="#555555" d="M648.01,-296.59C668.14,-280.76 701.78,-254.32 724.41,-236.52"/> +<polygon fill="#555555" stroke="#555555" points="725.59,-238.26 729.01,-232.91 722.99,-234.96 725.59,-238.26"/> </g> <!-- PTR_MORE->PTR_NULL --> <!-- PTR_MORE->PTR_ANY --> <g id="edge22" class="edge"> <title>PTR_MORE->PTR_ANY</title> -<path fill="none" stroke="#555555" d="M660.85,-307.1C652.94,-302.58 644.1,-297.55 636,-292.97 608.08,-277.18 576.81,-259.67 551.5,-245.54"/> -<polygon fill="#555555" stroke="#555555" points="552.79,-243.85 546.52,-242.76 550.74,-247.52 552.79,-243.85"/> +<path fill="none" stroke="#555555" d="M686.72,-297.75C654.45,-283.81 600.84,-260.66 559.66,-242.88"/> +<polygon fill="#555555" stroke="#555555" points="560.63,-241.01 554.29,-240.56 558.97,-244.86 560.63,-241.01"/> </g> <!-- PTR_MORE->PTR_MORE_NIL --> <g id="edge25" class="edge"> <title>PTR_MORE->PTR_MORE_NIL</title> -<path fill="none" stroke="#555555" d="M706.88,-306.42C734.22,-288.25 781.1,-257.11 811.3,-237.04"/> -<polygon fill="#555555" stroke="#555555" points="812.38,-238.85 816.22,-233.78 810.06,-235.35 812.38,-238.85"/> +<path fill="none" stroke="#555555" d="M735.36,-294.98C756.57,-279.37 789.9,-254.84 813.23,-237.67"/> +<polygon fill="#555555" stroke="#555555" points="814.42,-239.4 818.01,-234.16 811.93,-236.02 814.42,-239.4"/> </g> <!-- PTR_PERSON_NIL->PTR_BOT --> <g id="edge30" class="edge"> @@ -397,8 +396,8 @@ <!-- STRUCT_TOP->STRUCT_PERSON --> <g id="edge36" class="edge"> <title>STRUCT_TOP->STRUCT_PERSON</title> -<path fill="none" stroke="#555555" d="M988.85,-397.89C978.61,-357.71 959.89,-284.26 949.83,-244.77"/> -<polygon fill="#555555" stroke="#555555" points="951.95,-244.58 948.43,-239.28 947.88,-245.61 951.95,-244.58"/> +<path fill="none" stroke="#555555" d="M987.95,-375.71C977.84,-340.23 960.61,-279.78 950.68,-244.92"/> +<polygon fill="#555555" stroke="#555555" points="952.75,-244.54 949.09,-239.35 948.72,-245.69 952.75,-244.54"/> </g> <!-- STRUCT_S1 --> <g id="node23" class="node"> @@ -410,8 +409,8 @@ <!-- STRUCT_TOP->STRUCT_S1 --> <g id="edge37" class="edge"> <title>STRUCT_TOP->STRUCT_S1</title> -<path fill="none" stroke="#555555" d="M999.24,-397.89C1003.85,-357.88 1012.28,-284.87 1016.85,-245.27"/> -<polygon fill="#555555" stroke="#555555" points="1018.94,-245.52 1017.54,-239.32 1014.76,-245.04 1018.94,-245.52"/> +<path fill="none" stroke="#555555" d="M999.65,-375.71C1004.22,-340.23 1012.02,-279.78 1016.52,-244.92"/> +<polygon fill="#555555" stroke="#555555" points="1018.55,-245.61 1017.24,-239.39 1014.39,-245.07 1018.55,-245.61"/> </g> <!-- STRUCT_S2 --> <g id="node24" class="node"> @@ -423,8 +422,8 @@ <!-- STRUCT_TOP->STRUCT_S2 --> <g id="edge38" class="edge"> <title>STRUCT_TOP->STRUCT_S2</title> -<path fill="none" stroke="#555555" d="M1011.01,-398.32C1032.86,-358.11 1073.16,-283.94 1094.64,-244.41"/> -<polygon fill="#555555" stroke="#555555" points="1096.43,-245.51 1097.45,-239.24 1092.74,-243.51 1096.43,-245.51"/> +<path fill="none" stroke="#555555" d="M1012.67,-376.51C1034.35,-340.84 1071.93,-278.99 1093.18,-244.02"/> +<polygon fill="#555555" stroke="#555555" points="1094.84,-245.33 1096.16,-239.11 1091.25,-243.14 1094.84,-245.33"/> </g> <!-- STRUCT_MORE --> <g id="node25" class="node"> @@ -435,8 +434,8 @@ <!-- STRUCT_TOP->STRUCT_MORE --> <g id="edge39" class="edge"> <title>STRUCT_TOP->STRUCT_MORE</title> -<path fill="none" stroke="#555555" d="M1021.18,-400.02C1061.16,-358.86 1138.49,-279.24 1176.23,-240.39"/> -<polygon fill="#555555" stroke="#555555" points="1177.33,-242.26 1180.01,-236.5 1174.32,-239.34 1177.33,-242.26"/> +<path fill="none" stroke="#555555" d="M1023.66,-378.49C1063.42,-341.89 1136.06,-275.01 1173.79,-240.26"/> +<polygon fill="#555555" stroke="#555555" points="1174.99,-242.01 1177.99,-236.4 1172.15,-238.92 1174.99,-242.01"/> </g> <!-- STRUCT_TOP->MEM_TOP --> <!-- STRUCT_BOT --> @@ -488,8 +487,8 @@ <!-- MEM_TOP->MEM_BOT --> <g id="edge44" class="edge"> <title>MEM_TOP->MEM_BOT</title> -<path fill="none" stroke="#555555" d="M1294,-408.67C1294,-356.2 1294,-198.53 1294,-137.49"/> -<polygon fill="#555555" stroke="#555555" points="1296.1,-137.72 1294,-131.72 1291.9,-137.72 1296.1,-137.72"/> +<path fill="none" stroke="#555555" d="M1294,-386.63C1294,-337.1 1294,-194.83 1294,-137.43"/> +<polygon fill="#555555" stroke="#555555" points="1296.1,-137.74 1294,-131.74 1291.9,-137.74 1296.1,-137.74"/> </g> <!-- MEM_TOP->TUPLE_TOP --> <!-- MEM_BOT->BOT --> @@ -501,38 +500,38 @@ <!-- TUPLE1 --> <g id="node30" class="node"> <title>TUPLE1</title> -<polygon fill="#ffc0cb" stroke="black" points="1418.88,-339.96 1363.12,-339.96 1363.12,-303.96 1418.88,-303.96 1418.88,-339.96"/> -<text text-anchor="middle" x="1391" y="-317.86" font-family="DejaVu Sans" font-size="13.00">(type)</text> +<polygon fill="#ffc0cb" stroke="black" points="1418.88,-328.97 1363.12,-328.97 1363.12,-292.97 1418.88,-292.97 1418.88,-328.97"/> +<text text-anchor="middle" x="1391" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type)</text> </g> <!-- TUPLE_TOP->TUPLE1 --> <g id="edge47" class="edge"> <title>TUPLE_TOP->TUPLE1</title> -<path fill="none" stroke="#555555" d="M1405.19,-408.93C1402.44,-392.26 1398.22,-366.67 1395.09,-347.74"/> -<polygon fill="#555555" stroke="#555555" points="1397.16,-347.4 1394.11,-341.83 1393.02,-348.09 1397.16,-347.4"/> +<path fill="none" stroke="#555555" d="M1404.8,-386.65C1402.19,-372.52 1398.47,-352.37 1395.54,-336.56"/> +<polygon fill="#555555" stroke="#555555" points="1397.61,-336.2 1394.46,-330.68 1393.48,-336.96 1397.61,-336.2"/> </g> <!-- TUPLE2 --> <g id="node31" class="node"> <title>TUPLE2</title> -<polygon fill="#ffc0cb" stroke="black" points="1529,-339.96 1435,-339.96 1435,-303.96 1529,-303.96 1529,-339.96"/> -<text text-anchor="middle" x="1482" y="-317.86" font-family="DejaVu Sans" font-size="13.00">(type, type)</text> +<polygon fill="#ffc0cb" stroke="black" points="1529,-328.97 1435,-328.97 1435,-292.97 1529,-292.97 1529,-328.97"/> +<text text-anchor="middle" x="1482" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, type)</text> </g> <!-- TUPLE_TOP->TUPLE2 --> <g id="edge48" class="edge"> <title>TUPLE_TOP->TUPLE2</title> -<path fill="none" stroke="#555555" d="M1419.89,-409.39C1432.2,-392.26 1451.54,-365.35 1465.37,-346.1"/> -<polygon fill="#555555" stroke="#555555" points="1466.97,-347.48 1468.76,-341.38 1463.56,-345.02 1466.97,-347.48"/> +<path fill="none" stroke="#555555" d="M1421.23,-387.51C1433,-372.87 1450.35,-351.31 1463.5,-334.97"/> +<polygon fill="#555555" stroke="#555555" points="1465.06,-336.38 1467.18,-330.39 1461.79,-333.74 1465.06,-336.38"/> </g> <!-- TUPLEN --> <g id="node32" class="node"> <title>TUPLEN</title> -<polygon fill="#ffc0cb" stroke="black" points="1622.75,-339.96 1545.25,-339.96 1545.25,-303.96 1622.75,-303.96 1622.75,-339.96"/> -<text text-anchor="middle" x="1584" y="-317.86" font-family="DejaVu Sans" font-size="13.00">(type, …)</text> +<polygon fill="#ffc0cb" stroke="black" points="1622.75,-328.97 1545.25,-328.97 1545.25,-292.97 1622.75,-292.97 1622.75,-328.97"/> +<text text-anchor="middle" x="1584" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, …)</text> </g> <!-- TUPLE_TOP->TUPLEN --> <g id="edge49" class="edge"> <title>TUPLE_TOP->TUPLEN</title> -<path fill="none" stroke="#555555" d="M1432.78,-411.64C1458.78,-396.61 1500.83,-372.23 1537,-350.95 1540.81,-348.7 1544.8,-346.35 1548.76,-344"/> -<polygon fill="#555555" stroke="#555555" points="1549.56,-345.97 1553.64,-341.1 1547.41,-342.36 1549.56,-345.97"/> +<path fill="none" stroke="#555555" d="M1434.35,-390.18C1463.39,-375.01 1510.42,-350.42 1544.01,-332.87"/> +<polygon fill="#555555" stroke="#555555" points="1544.85,-334.8 1549.2,-330.16 1542.91,-331.07 1544.85,-334.8"/> </g> <!-- TUPLE_BOT --> <g id="node29" class="node"> @@ -549,22 +548,22 @@ <!-- TUPLE1->TUPLE_BOT --> <g id="edge50" class="edge"> <title>TUPLE1->TUPLE_BOT</title> -<path fill="none" stroke="#555555" d="M1395.51,-303.58C1405.12,-266.56 1427.65,-179.82 1438.68,-137.32"/> -<polygon fill="#555555" stroke="#555555" points="1440.68,-137.97 1440.16,-131.63 1436.62,-136.91 1440.68,-137.97"/> +<path fill="none" stroke="#555555" d="M1395.79,-292.49C1405.46,-257.21 1427.33,-177.44 1438.37,-137.19"/> +<polygon fill="#555555" stroke="#555555" points="1440.33,-137.95 1439.9,-131.61 1436.28,-136.84 1440.33,-137.95"/> </g> <!-- TUPLE1->TUPLE2 --> <!-- TUPLE2->TUPLE_BOT --> <g id="edge51" class="edge"> <title>TUPLE2->TUPLE_BOT</title> -<path fill="none" stroke="#555555" d="M1478.91,-303.58C1472.32,-266.56 1456.89,-179.82 1449.33,-137.32"/> -<polygon fill="#555555" stroke="#555555" points="1451.44,-137.2 1448.32,-131.66 1447.3,-137.93 1451.44,-137.2"/> +<path fill="none" stroke="#555555" d="M1478.72,-292.49C1472.12,-257.37 1457.24,-178.17 1449.65,-137.74"/> +<polygon fill="#555555" stroke="#555555" points="1451.73,-137.43 1448.56,-131.92 1447.6,-138.2 1451.73,-137.43"/> </g> <!-- TUPLE2->TUPLEN --> <!-- TUPLEN->TUPLE_BOT --> <g id="edge52" class="edge"> <title>TUPLEN->TUPLE_BOT</title> -<path fill="none" stroke="#555555" d="M1572.39,-303.58C1547.38,-266.16 1488.41,-177.94 1460.36,-135.96"/> -<polygon fill="#555555" stroke="#555555" points="1462.21,-134.96 1457.13,-131.14 1458.72,-137.29 1462.21,-134.96"/> +<path fill="none" stroke="#555555" d="M1571.66,-292.49C1546.44,-256.74 1488.97,-175.3 1460.95,-135.59"/> +<polygon fill="#555555" stroke="#555555" points="1462.76,-134.52 1457.59,-130.83 1459.33,-136.94 1462.76,-134.52"/> </g> </g> </svg> diff --git a/chapter10b/README.md b/chapter10b/README.md index dfdf74d5..671d53c3 100644 --- a/chapter10b/README.md +++ b/chapter10b/README.md @@ -171,11 +171,10 @@ alias to become known later, using the same representation. Its private constructor memory, escape tracking, incomplete types, and module alias remapping are separate extensions and are not needed here. -Chapters 11-15 use this representation, including alias-specific load/store +Chapters 11-24 use this representation, including alias-specific load/store anti-dependencies. Chapter 15 adds allocation with partial memory and typed -alias contents. Chapters 16-24 currently retain their older parser-managed -memory chains; forwarding through those snapshots is tracked in the -[backport queue](../docs/chapter-backports.md). +alias contents. Chapter 16 extends initialization to constructor values, and +Chapter 18 carries whole memory across function calls. ## Build and test diff --git a/chapter10b/docs/example1.gv b/chapter10b/docs/example1.gv index 0b0a5feb..5e059d77 100644 --- a/chapter10b/docs/example1.gv +++ b/chapter10b/docs/example1.gv @@ -1,13 +1,20 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=BT; - node [shape=box]; - M [label="Initial memory"]; - X [label="Store x = 42"]; - Y [label="Loop: Store y"]; - L [label="Load x (42)"]; - L -> X -> M [color=blue]; Y -> M [color=green]; - MemMerge -> X [color=blue]; MemMerge -> Y [color=green]; - Return -> MemMerge; Return -> L; + + M [label="Initial memory" shape=octagon style="filled" fillcolor="#dcecff"]; + X [label="Store x = 42" shape=octagon style="filled" fillcolor="#dcecff"]; + Y [label="Loop: Store y" shape=octagon style="filled" fillcolor="#dcecff"]; + L [label="Load x (42)" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + L -> X -> M [color="#2867b2"]; Y -> M [color="#2867b2"]; + MemMerge -> X [color="#2867b2"]; MemMerge -> Y [color="#2867b2"]; + Return -> MemMerge [color="#2867b2"]; Return -> L; { rank=same; MemMerge -> L [style=invis]; } Y -> X [style=invis]; // Layout only: keep the stores in code order. + Return [shape=box style="filled" fillcolor="#fff1c4"]; + MemMerge [shape=octagon style="filled" fillcolor="#dcecff"]; } diff --git a/chapter10b/docs/example1.svg b/chapter10b/docs/example1.svg index 384b6e12..f0b57612 100644 --- a/chapter10b/docs/example1.svg +++ b/chapter10b/docs/example1.svg @@ -4,90 +4,90 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="206pt" height="332pt" - viewBox="0.00 0.00 205.75 332.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 328)"> +<svg width="255pt" height="348pt" + viewBox="0.00 0.00 254.55 348.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 344)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-328 201.75,-328 201.75,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-344 250.55,-344 250.55,4 -4,4"/> <!-- M --> <g id="node1" class="node"> <title>M</title> -<polygon fill="none" stroke="black" points="131.75,-324 33.25,-324 33.25,-288 131.75,-288 131.75,-324"/> -<text text-anchor="middle" x="82.5" y="-300.95" font-family="Times New Roman,serif" font-size="14.00">Initial memory</text> +<polygon fill="#dcecff" stroke="#758191" points="169.68,-314.54 169.68,-329.46 133.28,-340 81.81,-340 45.42,-329.46 45.42,-314.54 81.81,-304 133.28,-304 169.68,-314.54"/> +<text text-anchor="middle" x="107.55" y="-317.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Initial memory</text> </g> <!-- X --> <g id="node2" class="node"> <title>X</title> -<polygon fill="none" stroke="black" points="160.62,-252 76.38,-252 76.38,-216 160.62,-216 160.62,-252"/> -<text text-anchor="middle" x="118.5" y="-228.95" font-family="Times New Roman,serif" font-size="14.00">Store x = 42</text> +<polygon fill="#dcecff" stroke="#758191" points="210.45,-238.54 210.45,-253.46 178.29,-264 132.81,-264 100.65,-253.46 100.65,-238.54 132.81,-228 178.29,-228 210.45,-238.54"/> +<text text-anchor="middle" x="155.55" y="-241.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store x = 42</text> </g> <!-- X->M --> <g id="edge2" class="edge"> <title>X->M</title> -<path fill="none" stroke="blue" d="M109.6,-252.3C105.63,-260.02 100.87,-269.29 96.44,-277.89"/> -<polygon fill="blue" stroke="blue" points="93.45,-276.06 91.99,-286.55 99.67,-279.26 93.45,-276.06"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M135.16,-264.4C135.16,-264.4 135.16,-294.76 135.16,-294.76"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="132.71,-294.76 135.16,-301.76 137.61,-294.76 132.71,-294.76"/> </g> <!-- Y --> <g id="node3" class="node"> <title>Y</title> -<polygon fill="none" stroke="black" points="91,-180 0,-180 0,-144 91,-144 91,-180"/> -<text text-anchor="middle" x="45.5" y="-156.95" font-family="Times New Roman,serif" font-size="14.00">Loop: Store y</text> +<polygon fill="#dcecff" stroke="#758191" points="119.1,-162.54 119.1,-177.46 84.21,-188 34.88,-188 0,-177.46 0,-162.54 34.88,-152 84.21,-152 119.1,-162.54"/> +<text text-anchor="middle" x="59.55" y="-165.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Loop: Store y</text> </g> <!-- Y->M --> <g id="edge3" class="edge"> <title>Y->M</title> -<path fill="none" stroke="green" d="M49.63,-180.44C53.93,-198.41 60.94,-227.23 67.5,-252 69.64,-260.07 72.07,-268.81 74.33,-276.81"/> -<polygon fill="green" stroke="green" points="70.96,-277.75 77.07,-286.4 77.69,-275.82 70.96,-277.75"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M73.03,-188.33C73.03,-188.33 73.03,-297.09 73.03,-297.09"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="70.58,-297.09 73.03,-304.09 75.48,-297.09 70.58,-297.09"/> </g> <!-- Y->X --> <!-- L --> <g id="node4" class="node"> <title>L</title> -<polygon fill="none" stroke="black" points="197.75,-108 117.25,-108 117.25,-72 197.75,-72 197.75,-108"/> -<text text-anchor="middle" x="157.5" y="-84.95" font-family="Times New Roman,serif" font-size="14.00">Load x (42)</text> +<path fill="#edf3f7" stroke="#758191" d="M234.55,-112C234.55,-112 182.55,-112 182.55,-112 176.55,-112 170.55,-106 170.55,-100 170.55,-100 170.55,-88 170.55,-88 170.55,-82 176.55,-76 182.55,-76 182.55,-76 234.55,-76 234.55,-76 240.55,-76 246.55,-82 246.55,-88 246.55,-88 246.55,-100 246.55,-100 246.55,-106 240.55,-112 234.55,-112"/> +<text text-anchor="middle" x="208.55" y="-89.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Load x (42)</text> </g> <!-- L->X --> <g id="edge1" class="edge"> <title>L->X</title> -<path fill="none" stroke="blue" d="M152.87,-108.41C148.09,-126.37 140.36,-155.17 133.5,-180 131.28,-188.05 128.82,-196.78 126.56,-204.78"/> -<polygon fill="blue" stroke="blue" points="123.2,-203.8 123.83,-214.37 129.93,-205.71 123.2,-203.8"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M190.5,-112.33C190.5,-112.33 190.5,-222.4 190.5,-222.4"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="188.05,-222.4 190.5,-229.4 192.95,-222.4 188.05,-222.4"/> </g> <!-- MemMerge --> <g id="node5" class="node"> <title>MemMerge</title> -<polygon fill="none" stroke="black" points="99.5,-108 17.5,-108 17.5,-72 99.5,-72 99.5,-108"/> -<text text-anchor="middle" x="58.5" y="-84.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> +<polygon fill="#dcecff" stroke="#758191" points="145.87,-86.54 145.87,-101.46 115.22,-112 71.88,-112 41.23,-101.46 41.23,-86.54 71.88,-76 115.22,-76 145.87,-86.54"/> +<text text-anchor="middle" x="93.55" y="-89.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">MemMerge</text> </g> <!-- MemMerge->X --> <g id="edge4" class="edge"> <title>MemMerge->X</title> -<path fill="none" stroke="blue" d="M75.59,-108.21C84.32,-117.95 94.37,-130.8 100.5,-144 109.34,-163.03 113.85,-186.32 116.15,-204.31"/> -<polygon fill="blue" stroke="blue" points="112.64,-204.46 117.22,-214.02 119.6,-203.7 112.64,-204.46"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M132.48,-106.44C132.48,-106.44 132.48,-218.56 132.48,-218.56"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="130.03,-218.56 132.48,-225.56 134.93,-218.56 130.03,-218.56"/> </g> <!-- MemMerge->Y --> <g id="edge5" class="edge"> <title>MemMerge->Y</title> -<path fill="none" stroke="green" d="M55.29,-108.3C53.92,-115.68 52.28,-124.48 50.75,-132.75"/> -<polygon fill="green" stroke="green" points="47.34,-131.94 48.95,-142.41 54.22,-133.21 47.34,-131.94"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M80.16,-112.4C80.16,-112.4 80.16,-142.24 80.16,-142.24"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="77.71,-142.24 80.16,-149.24 82.61,-142.24 77.71,-142.24"/> </g> <!-- MemMerge->L --> <!-- Return --> <g id="node6" class="node"> <title>Return</title> -<polygon fill="none" stroke="black" points="134.5,-36 80.5,-36 80.5,0 134.5,0 134.5,-36"/> -<text text-anchor="middle" x="107.5" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> +<polygon fill="#fff1c4" stroke="#758191" points="177.55,-36 123.55,-36 123.55,0 177.55,0 177.55,-36"/> +<text text-anchor="middle" x="150.55" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Return</text> </g> <!-- Return->L --> <g id="edge7" class="edge"> <title>Return->L</title> -<path fill="none" stroke="black" d="M119.86,-36.3C125.55,-44.27 132.43,-53.9 138.74,-62.74"/> -<polygon fill="black" stroke="black" points="135.74,-64.56 144.4,-70.66 141.44,-60.49 135.74,-64.56"/> +<path fill="none" stroke="#536477" stroke-width="1.5" d="M174.05,-36.4C174.05,-36.4 174.05,-66.24 174.05,-66.24"/> +<polygon fill="#536477" stroke="#536477" stroke-width="1.5" points="171.6,-66.24 174.05,-73.24 176.5,-66.24 171.6,-66.24"/> </g> <!-- Return->MemMerge --> <g id="edge6" class="edge"> <title>Return->MemMerge</title> -<path fill="none" stroke="black" d="M95.39,-36.3C89.81,-44.27 83.07,-53.9 76.88,-62.74"/> -<polygon fill="black" stroke="black" points="74.21,-60.46 71.34,-70.66 79.94,-64.47 74.21,-60.46"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M134.71,-36.4C134.71,-36.4 134.71,-73.34 134.71,-73.34"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="132.26,-73.34 134.71,-80.34 137.16,-73.34 132.26,-73.34"/> </g> </g> </svg> diff --git a/chapter10b/docs/example2a.gv b/chapter10b/docs/example2a.gv index d92eea41..187e63b9 100644 --- a/chapter10b/docs/example2a.gv +++ b/chapter10b/docs/example2a.gv @@ -1,10 +1,17 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - M [label="Default memory"]; - X [label="Store x"]; - Y [label="Store y"]; - X -> M [color=blue]; Y -> M [color=green]; - MemMerge -> M [label="default"]; MemMerge -> X [label="x",color=blue]; - MemMerge -> Y [label="y",color=green]; Return -> MemMerge; + + M [label="Default memory" shape=octagon style="filled" fillcolor="#dcecff"]; + X [label="Store x" shape=octagon style="filled" fillcolor="#dcecff"]; + Y [label="Store y" shape=octagon style="filled" fillcolor="#dcecff"]; + X -> M [color="#2867b2"]; Y -> M [color="#2867b2"]; + MemMerge -> M [xlabel="default",color="#2867b2"]; MemMerge -> X [xlabel="x",color="#2867b2"]; + MemMerge -> Y [xlabel="y",color="#2867b2"]; Return -> MemMerge [color="#2867b2"]; + Return [shape=box style="filled" fillcolor="#fff1c4"]; + MemMerge [shape=octagon style="filled" fillcolor="#dcecff"]; } diff --git a/chapter10b/docs/example2a.svg b/chapter10b/docs/example2a.svg index 97fb144e..47bc3a8f 100644 --- a/chapter10b/docs/example2a.svg +++ b/chapter10b/docs/example2a.svg @@ -4,79 +4,79 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="423pt" height="126pt" - viewBox="0.00 0.00 422.50 125.93" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 121.93)"> +<svg width="498pt" height="105pt" + viewBox="0.00 0.00 497.99 105.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 101)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-121.93 418.5,-121.93 418.5,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-101 493.99,-101 493.99,4 -4,4"/> <!-- M --> <g id="node1" class="node"> <title>M</title> -<polygon fill="none" stroke="black" points="106.75,-90 0,-90 0,-54 106.75,-54 106.75,-90"/> -<text text-anchor="middle" x="53.38" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">Default memory</text> +<polygon fill="#dcecff" stroke="#758191" points="137.69,-71.54 137.69,-86.46 97.36,-97 40.33,-97 0,-86.46 0,-71.54 40.33,-61 97.36,-61 137.69,-71.54"/> +<text text-anchor="middle" x="68.84" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Default memory</text> </g> <!-- X --> <g id="node2" class="node"> <title>X</title> -<polygon fill="none" stroke="black" points="198.75,-90 143.75,-90 143.75,-54 198.75,-54 198.75,-90"/> -<text text-anchor="middle" x="171.25" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">Store x</text> +<polygon fill="#dcecff" stroke="#758191" points="251.35,-71.54 251.35,-86.46 229.77,-97 199.26,-97 177.69,-86.46 177.69,-71.54 199.26,-61 229.77,-61 251.35,-71.54"/> +<text text-anchor="middle" x="214.52" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store x</text> </g> <!-- X->M --> <g id="edge1" class="edge"> <title>X->M</title> -<path fill="none" stroke="blue" d="M143.37,-72C135.84,-72 127.32,-72 118.6,-72"/> -<polygon fill="blue" stroke="blue" points="118.61,-68.5 108.61,-72 118.61,-75.5 118.61,-68.5"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M177.38,-79C177.38,-79 147.2,-79 147.2,-79"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="147.2,-76.55 140.2,-79 147.2,-81.45 147.2,-76.55"/> </g> <!-- Y --> <g id="node3" class="node"> <title>Y</title> -<polygon fill="none" stroke="black" points="198.75,-36 143.75,-36 143.75,0 198.75,0 198.75,-36"/> -<text text-anchor="middle" x="171.25" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Store y</text> +<polygon fill="#dcecff" stroke="#758191" points="251.35,-10.54 251.35,-25.46 229.77,-36 199.26,-36 177.69,-25.46 177.69,-10.54 199.26,0 229.77,0 251.35,-10.54"/> +<text text-anchor="middle" x="214.52" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store y</text> </g> <!-- Y->M --> <g id="edge2" class="edge"> <title>Y->M</title> -<path fill="none" stroke="green" d="M143.37,-30.52C131.65,-35.99 117.53,-42.57 104.01,-48.87"/> -<polygon fill="green" stroke="green" points="102.81,-45.57 95.22,-52.97 105.76,-51.91 102.81,-45.57"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M177.51,-18C127.88,-18 45.9,-18 45.9,-18 45.9,-18 36.62,-18 36.62,-18"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="41.53,-52.16 45.41,-58.48 46.32,-51.12 41.53,-52.16"/> </g> <!-- MemMerge --> <g id="node4" class="node"> <title>MemMerge</title> -<polygon fill="none" stroke="black" points="323.5,-90 241.5,-90 241.5,-54 323.5,-54 323.5,-90"/> -<text text-anchor="middle" x="282.5" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> +<polygon fill="#dcecff" stroke="#758191" points="395.99,-71.54 395.99,-86.46 365.34,-97 322,-97 291.35,-86.46 291.35,-71.54 322,-61 365.34,-61 395.99,-71.54"/> +<text text-anchor="middle" x="343.67" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">MemMerge</text> </g> <!-- MemMerge->M --> <g id="edge3" class="edge"> <title>MemMerge->M</title> -<path fill="none" stroke="black" d="M241.39,-88.58C228.08,-93.14 213,-97.3 198.75,-99 174.48,-101.9 167.93,-102.57 143.75,-99 135.07,-97.72 126.06,-95.77 117.26,-93.5"/> -<polygon fill="black" stroke="black" points="118.28,-90.15 107.71,-90.87 116.42,-96.9 118.28,-90.15"/> -<text text-anchor="middle" x="171.25" y="-104.63" font-family="Times New Roman,serif" font-size="14.00">default</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M361.11,-60.55C361.11,-54.13 361.11,-48.5 361.11,-48.5 361.11,-48.5 91.79,-48.5 91.79,-48.5 91.79,-48.5 91.79,-51.28 91.79,-51.28"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="89.34,-51.28 91.79,-58.28 94.24,-51.28 89.34,-51.28"/> +<text text-anchor="middle" x="244.96" y="-39.95" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">default</text> </g> <!-- MemMerge->X --> <g id="edge4" class="edge"> <title>MemMerge->X</title> -<path fill="none" stroke="blue" d="M241.13,-72C231.08,-72 220.34,-72 210.4,-72"/> -<polygon fill="blue" stroke="blue" points="210.71,-68.5 200.71,-72 210.71,-75.5 210.71,-68.5"/> -<text text-anchor="middle" x="220.12" y="-75.2" font-family="Times New Roman,serif" font-size="14.00">x</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M291.14,-79C291.14,-79 260.84,-79 260.84,-79"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="260.84,-76.55 253.84,-79 260.84,-81.45 260.84,-76.55"/> +<text text-anchor="middle" x="278.24" y="-70.45" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">x</text> </g> <!-- MemMerge->Y --> <g id="edge5" class="edge"> <title>MemMerge->Y</title> -<path fill="none" stroke="green" d="M244.21,-53.57C232.85,-47.95 220.38,-41.79 209.05,-36.19"/> -<polygon fill="green" stroke="green" points="210.91,-33.2 200.39,-31.91 207.81,-39.48 210.91,-33.2"/> -<text text-anchor="middle" x="220.12" y="-44.97" font-family="Times New Roman,serif" font-size="14.00">y</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M326.23,-60.7C326.23,-42.73 326.23,-18 326.23,-18 326.23,-18 260.98,-18 260.98,-18"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="260.98,-15.55 253.98,-18 260.98,-20.45 260.98,-15.55"/> +<text text-anchor="middle" x="317.21" y="-9.45" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">y</text> </g> <!-- Return --> <g id="node5" class="node"> <title>Return</title> -<polygon fill="none" stroke="black" points="414.5,-90 360.5,-90 360.5,-54 414.5,-54 414.5,-90"/> -<text text-anchor="middle" x="387.5" y="-66.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> +<polygon fill="#fff1c4" stroke="#758191" points="489.99,-97 435.99,-97 435.99,-61 489.99,-61 489.99,-97"/> +<text text-anchor="middle" x="462.99" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Return</text> </g> <!-- Return->MemMerge --> <g id="edge6" class="edge"> <title>Return->MemMerge</title> -<path fill="none" stroke="black" d="M360.24,-72C352.53,-72 343.82,-72 335.11,-72"/> -<polygon fill="black" stroke="black" points="335.25,-68.5 325.25,-72 335.25,-75.5 335.25,-68.5"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M435.61,-79C435.61,-79 405.55,-79 405.55,-79"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="405.55,-76.55 398.55,-79 405.55,-81.45 405.55,-76.55"/> </g> </g> </svg> diff --git a/chapter10b/docs/example2b.gv b/chapter10b/docs/example2b.gv index 4ddd36b5..39b87a6a 100644 --- a/chapter10b/docs/example2b.gv +++ b/chapter10b/docs/example2b.gv @@ -1,10 +1,19 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - P [label="MemPhi(x)"]; - B [label="BulkMemPhi(All except x)"]; - P -> Left [label="slice x",color=blue]; P -> Right [label="slice x",color=blue]; - B -> Left; B -> Right; - P -> Region [style=dashed]; B -> Region [style=dashed]; - MemMerge -> P [label="x",color=blue]; MemMerge -> B [label="default"]; + + P [label="MemPhi(x)" shape=hexagon style="filled" fillcolor="#f5e4fa"]; + B [label="BulkMemPhi(All except x)" shape=hexagon style="filled" fillcolor="#f5e4fa"]; + P -> Left [xlabel="slice x",color="#2867b2"]; P -> Right [xlabel="slice x",color="#2867b2"]; + B -> Left [color="#2867b2"]; B -> Right [color="#2867b2"]; + P -> Region [style=dashed,color="#9396a3"]; B -> Region [style=dashed,color="#9396a3"]; + MemMerge -> P [xlabel="x",color="#2867b2"]; MemMerge -> B [xlabel="default",color="#2867b2"]; + MemMerge [shape=octagon style="filled" fillcolor="#dcecff"]; + Left [shape=octagon style="filled" fillcolor="#dcecff"]; + Right [shape=octagon style="filled" fillcolor="#dcecff"]; + Region [shape=trapezium style="filled" fillcolor="#fff1c4"]; } diff --git a/chapter10b/docs/example2b.svg b/chapter10b/docs/example2b.svg index 4e0616f1..cb10b90b 100644 --- a/chapter10b/docs/example2b.svg +++ b/chapter10b/docs/example2b.svg @@ -4,98 +4,98 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="456pt" height="170pt" - viewBox="0.00 0.00 455.75 170.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 166)"> +<svg width="517pt" height="166pt" + viewBox="0.00 0.00 516.68 166.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 162)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-166 451.75,-166 451.75,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-162 512.68,-162 512.68,4 -4,4"/> <!-- P --> <g id="node1" class="node"> <title>P</title> -<polygon fill="none" stroke="black" points="249.12,-67 169.38,-67 169.38,-31 249.12,-31 249.12,-67"/> -<text text-anchor="middle" x="209.25" y="-43.95" font-family="Times New Roman,serif" font-size="14.00">MemPhi(x)</text> +<polygon fill="#f5e4fa" stroke="#758191" points="305.65,-109 278.57,-127 224.41,-127 197.33,-109 224.41,-91 278.57,-91 305.65,-109"/> +<text text-anchor="middle" x="251.49" y="-104.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">MemPhi(x)</text> </g> <!-- Left --> <g id="node3" class="node"> <title>Left</title> -<polygon fill="none" stroke="black" points="54.5,-102 0.5,-102 0.5,-66 54.5,-66 54.5,-102"/> -<text text-anchor="middle" x="27.5" y="-78.95" font-family="Times New Roman,serif" font-size="14.00">Left</text> +<polygon fill="#dcecff" stroke="#758191" points="76.47,-132.54 76.47,-147.46 60.65,-158 38.29,-158 22.47,-147.46 22.47,-132.54 38.29,-122 60.65,-122 76.47,-132.54"/> +<text text-anchor="middle" x="49.47" y="-135.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Left</text> </g> <!-- P->Left --> <g id="edge1" class="edge"> <title>P->Left</title> -<path fill="none" stroke="blue" d="M169.09,-45.11C141.55,-43.68 104.19,-44.4 73,-54.5 68.76,-55.87 64.54,-57.77 60.48,-59.95"/> -<polygon fill="blue" stroke="blue" points="58.85,-56.85 52.11,-65.02 62.48,-62.84 58.85,-56.85"/> -<text text-anchor="middle" x="90.62" y="-57.7" font-family="Times New Roman,serif" font-size="14.00">slice x</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M206.74,-115.75C144.8,-115.75 40.47,-115.75 40.47,-115.75 40.47,-115.75 35.19,-115.75 35.19,-115.75"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="32.45,-116.37 38.95,-119.93 36.09,-113.09 32.45,-116.37"/> +<text text-anchor="middle" x="108.21" y="-107.2" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">slice x</text> </g> <!-- Right --> <g id="node4" class="node"> <title>Right</title> -<polygon fill="none" stroke="black" points="54.5,-162 0.5,-162 0.5,-126 54.5,-126 54.5,-162"/> -<text text-anchor="middle" x="27.5" y="-138.95" font-family="Times New Roman,serif" font-size="14.00">Right</text> +<polygon fill="#dcecff" stroke="#758191" points="80.11,-71.54 80.11,-86.46 62.16,-97 36.78,-97 18.84,-86.46 18.84,-71.54 36.78,-61 62.16,-61 80.11,-71.54"/> +<text text-anchor="middle" x="49.47" y="-74.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Right</text> </g> <!-- P->Right --> <g id="edge2" class="edge"> <title>P->Right</title> -<path fill="none" stroke="blue" d="M168.93,-64.2C141.32,-75.51 103.94,-92.12 73,-110.5 68.67,-113.07 64.27,-115.98 59.99,-118.98"/> -<polygon fill="blue" stroke="blue" points="58.15,-115.99 52.15,-124.72 62.29,-121.64 58.15,-115.99"/> -<text text-anchor="middle" x="90.62" y="-113.7" font-family="Times New Roman,serif" font-size="14.00">slice x</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M197.21,-109.5C140.12,-109.5 58.47,-109.5 58.47,-109.5 58.47,-109.5 67.74,-109.5 67.74,-109.5"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="66.06,-103.3 59.86,-99.25 62.18,-106.29 66.06,-103.3"/> +<text text-anchor="middle" x="135.96" y="-100.95" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">slice x</text> </g> <!-- Region --> <g id="node5" class="node"> <title>Region</title> -<polygon fill="none" stroke="black" points="55,-36 0,-36 0,0 55,0 55,-36"/> -<text text-anchor="middle" x="27.5" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Region</text> +<polygon fill="#fff1c4" stroke="#758191" points="78.36,-36 20.58,-36 0,0 98.94,0 78.36,-36"/> +<text text-anchor="middle" x="49.47" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Region</text> </g> <!-- P->Region --> <g id="edge5" class="edge"> <title>P->Region</title> -<path fill="none" stroke="black" stroke-dasharray="5,2" d="M171.76,-30.51C153.24,-22.15 130.1,-13.21 108.25,-9 94.7,-6.39 79.71,-7.15 66.41,-9.05"/> -<polygon fill="black" stroke="black" points="66,-5.57 56.73,-10.71 67.18,-12.47 66,-5.57"/> +<path fill="none" stroke="#9396a3" stroke-width="1.5" stroke-dasharray="5,2" d="M205.5,-103.25C156.65,-103.25 86.38,-103.25 86.38,-103.25 86.38,-103.25 95.66,-103.25 95.66,-103.25"/> +<polygon fill="#9396a3" stroke="#9396a3" stroke-width="1.5" points="89.88,-31.51 86.64,-24.84 85.01,-32.07 89.88,-31.51"/> </g> <!-- B --> <g id="node2" class="node"> <title>B</title> -<polygon fill="none" stroke="black" points="292.25,-132 126.25,-132 126.25,-96 292.25,-96 292.25,-132"/> -<text text-anchor="middle" x="209.25" y="-108.95" font-family="Times New Roman,serif" font-size="14.00">BulkMemPhi(All except x)</text> +<polygon fill="#f5e4fa" stroke="#758191" points="364.04,-48 307.77,-66 195.22,-66 138.94,-48 195.22,-30 307.77,-30 364.04,-48"/> +<text text-anchor="middle" x="251.49" y="-43.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">BulkMemPhi(All except x)</text> </g> <!-- B->Left --> <g id="edge3" class="edge"> <title>B->Left</title> -<path fill="none" stroke="black" d="M126.03,-119C108.27,-118.2 89.8,-115.9 73,-111 69.91,-110.1 66.82,-108.93 63.78,-107.57"/> -<polygon fill="black" stroke="black" points="65.62,-104.58 55.13,-103.12 62.42,-110.81 65.62,-104.58"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M177.87,-60.74C177.87,-86.54 177.87,-142.5 177.87,-142.5 177.87,-142.5 85.97,-142.5 85.97,-142.5"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="85.97,-140.05 78.97,-142.5 85.97,-144.95 85.97,-140.05"/> </g> <!-- B->Right --> <g id="edge4" class="edge"> <title>B->Right</title> -<path fill="none" stroke="black" d="M126,-127.73C104.92,-131.25 83.28,-134.86 65.75,-137.78"/> -<polygon fill="black" stroke="black" points="65.66,-134.25 56.37,-139.35 66.81,-141.15 65.66,-134.25"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M158.4,-54.74C158.4,-65.35 158.4,-84.75 158.4,-84.75 158.4,-84.75 89.67,-84.75 89.67,-84.75"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="89.67,-82.3 82.67,-84.75 89.67,-87.2 89.67,-82.3"/> </g> <!-- B->Region --> <g id="edge6" class="edge"> <title>B->Region</title> -<path fill="none" stroke="black" stroke-dasharray="5,2" d="M167.07,-95.69C153.92,-89.64 139.38,-82.73 126.25,-76 102.07,-63.61 96.34,-59.9 73,-46 70.37,-44.43 67.67,-42.8 64.95,-41.14"/> -<polygon fill="black" stroke="black" points="66.83,-38.18 56.48,-35.89 63.14,-44.13 66.83,-38.18"/> +<path fill="none" stroke="#9396a3" stroke-width="1.5" stroke-dasharray="5,2" d="M139.03,-48.5C112.95,-48.5 92.66,-48.5 92.66,-48.5 92.66,-48.5 101.93,-48.5 101.93,-48.5"/> +<polygon fill="#9396a3" stroke="#9396a3" stroke-width="1.5" points="97.71,-26.24 93.33,-20.26 93.02,-27.67 97.71,-26.24"/> </g> <!-- MemMerge --> <g id="node6" class="node"> <title>MemMerge</title> -<polygon fill="none" stroke="black" points="447.75,-94 365.75,-94 365.75,-58 447.75,-58 447.75,-94"/> -<text text-anchor="middle" x="406.75" y="-70.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> +<polygon fill="#dcecff" stroke="#758191" points="508.68,-70.54 508.68,-85.46 478.03,-96 434.69,-96 404.04,-85.46 404.04,-70.54 434.69,-60 478.03,-60 508.68,-70.54"/> +<text text-anchor="middle" x="456.36" y="-73.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">MemMerge</text> </g> <!-- MemMerge->P --> <g id="edge7" class="edge"> <title>MemMerge->P</title> -<path fill="none" stroke="blue" d="M365.39,-64.23C359.51,-62.81 353.5,-61.5 347.75,-60.5 319.17,-55.53 286.87,-52.69 260.76,-51.07"/> -<polygon fill="blue" stroke="blue" points="261.3,-47.6 251.11,-50.52 260.9,-54.59 261.3,-47.6"/> -<text text-anchor="middle" x="329" y="-63.7" font-family="Times New Roman,serif" font-size="14.00">x</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M403.6,-78.5C342.9,-78.5 251.49,-78.5 251.49,-78.5 251.49,-78.5 251.49,-81.28 251.49,-81.28"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="249.04,-81.28 251.49,-88.28 253.94,-81.28 249.04,-81.28"/> +<text text-anchor="middle" x="328.4" y="-69.95" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">x</text> </g> <!-- MemMerge->B --> <g id="edge8" class="edge"> <title>MemMerge->B</title> -<path fill="none" stroke="black" d="M365.72,-83.78C347.65,-87.29 325.5,-91.6 303.63,-95.85"/> -<polygon fill="black" stroke="black" points="303.23,-92.36 294.08,-97.71 304.56,-99.23 303.23,-92.36"/> -<text text-anchor="middle" x="329" y="-97.06" font-family="Times New Roman,serif" font-size="14.00">default</text> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M403.77,-72.25C370.93,-72.25 334.85,-72.25 334.85,-72.25 334.85,-72.25 334.85,-66.85 334.85,-66.85"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="337.3,-66.85 334.85,-59.85 332.4,-66.85 337.3,-66.85"/> +<text text-anchor="middle" x="380.49" y="-63.7" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">default</text> </g> </g> </svg> diff --git a/chapter10b/docs/example2c.gv b/chapter10b/docs/example2c.gv index 4fae3bba..b32d186d 100644 --- a/chapter10b/docs/example2c.gv +++ b/chapter10b/docs/example2c.gv @@ -1,10 +1,15 @@ digraph Memory { + // IR styles match graph/web/render.js; arrows are use -> definition. + graph [bgcolor="#fafbfc" fontname="Helvetica" nodesep=0.35 ranksep=0.55 splines=ortho]; + node [fontname="Helvetica" fontsize=12 color="#758191" fontcolor="#152330" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + edge [fontname="Helvetica" fontsize=9 color="#536477" fontcolor="#364352" arrowsize=0.7 penwidth=1.5]; + rankdir=RL; - node [shape=box]; - M [label="Prior x memory"]; - L [label="Load p.x"]; - S [label="Store p.x"]; - L -> M [color=blue]; S -> M [color=blue]; - S -> L [style=dashed,label="execute load first"]; - Y [label="Store p.y: independent"]; + + M [label="Prior x memory" shape=octagon style="filled" fillcolor="#dcecff"]; + L [label="Load p.x" shape=box style="rounded,filled" fillcolor="#edf3f7"]; + S [label="Store p.x" shape=octagon style="filled" fillcolor="#dcecff"]; + L -> M [color="#2867b2"]; S -> M [color="#2867b2"]; + S -> L [style=dashed,xlabel="execute load first"]; + Y [label="Store p.y: independent" shape=octagon style="filled" fillcolor="#dcecff"]; } diff --git a/chapter10b/docs/example2c.svg b/chapter10b/docs/example2c.svg index 8249d677..531fabfe 100644 --- a/chapter10b/docs/example2c.svg +++ b/chapter10b/docs/example2c.svg @@ -4,53 +4,53 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Memory Pages: 1 --> -<svg width="482pt" height="121pt" - viewBox="0.00 0.00 482.25 121.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 117)"> +<svg width="470pt" height="133pt" + viewBox="0.00 0.00 469.52 133.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 129)"> <title>Memory</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-117 478.25,-117 478.25,4 -4,4"/> +<polygon fill="#fafbfc" stroke="none" points="-4,4 -4,-129 465.52,-129 465.52,4 -4,4"/> <!-- M --> <g id="node1" class="node"> <title>M</title> -<polygon fill="none" stroke="black" points="103.75,-59 0,-59 0,-23 103.75,-23 103.75,-59"/> -<text text-anchor="middle" x="51.88" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Prior x memory</text> +<polygon fill="#dcecff" stroke="#758191" points="132.52,-38.54 132.52,-53.46 93.71,-64 38.81,-64 0,-53.46 0,-38.54 38.81,-28 93.71,-28 132.52,-38.54"/> +<text text-anchor="middle" x="66.26" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Prior x memory</text> </g> <!-- L --> <g id="node2" class="node"> <title>L</title> -<polygon fill="none" stroke="black" points="205.5,-36 140.75,-36 140.75,0 205.5,0 205.5,-36"/> -<text text-anchor="middle" x="173.12" y="-12.95" font-family="Times New Roman,serif" font-size="14.00">Load p.x</text> +<path fill="#edf3f7" stroke="#758191" d="M222.27,-36C222.27,-36 184.52,-36 184.52,-36 178.52,-36 172.52,-30 172.52,-24 172.52,-24 172.52,-12 172.52,-12 172.52,-6 178.52,0 184.52,0 184.52,0 222.27,0 222.27,0 228.27,0 234.27,-6 234.27,-12 234.27,-12 234.27,-24 234.27,-24 234.27,-30 228.27,-36 222.27,-36"/> +<text text-anchor="middle" x="203.4" y="-13.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Load p.x</text> </g> <!-- L->M --> <g id="edge1" class="edge"> <title>L->M</title> -<path fill="none" stroke="blue" d="M140.48,-24.1C132.62,-25.62 123.92,-27.3 115.15,-28.99"/> -<polygon fill="blue" stroke="blue" points="114.69,-25.51 105.54,-30.84 116.02,-32.39 114.69,-25.51"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M172.28,-32C172.28,-32 119.52,-32 119.52,-32"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="119.52,-29.55 112.52,-32 119.52,-34.45 119.52,-29.55"/> </g> <!-- S --> <g id="node3" class="node"> <title>S</title> -<polygon fill="none" stroke="black" points="437.5,-59 372,-59 372,-23 437.5,-23 437.5,-59"/> -<text text-anchor="middle" x="404.75" y="-35.95" font-family="Times New Roman,serif" font-size="14.00">Store p.x</text> +<polygon fill="#dcecff" stroke="#758191" points="411.44,-38.54 411.44,-53.46 385.93,-64 349.86,-64 324.36,-53.46 324.36,-38.54 349.86,-28 385.93,-28 411.44,-38.54"/> +<text text-anchor="middle" x="367.9" y="-41.73" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store p.x</text> </g> <!-- S->M --> <g id="edge2" class="edge"> <title>S->M</title> -<path fill="none" stroke="blue" d="M371.77,-45.13C355.48,-47.03 335.34,-49.06 317.25,-50 248.24,-53.58 169.03,-49.84 115.44,-46.15"/> -<polygon fill="blue" stroke="blue" points="115.81,-42.67 105.58,-45.45 115.31,-49.65 115.81,-42.67"/> +<path fill="none" stroke="#2867b2" stroke-width="1.5" d="M324.04,-50C324.04,-50 142.29,-50 142.29,-50"/> +<polygon fill="#2867b2" stroke="#2867b2" stroke-width="1.5" points="142.29,-47.55 135.29,-50 142.29,-52.45 142.29,-47.55"/> </g> <!-- S->L --> <g id="edge3" class="edge"> <title>S->L</title> -<path fill="none" stroke="black" stroke-dasharray="5,2" d="M371.82,-37.8C331.55,-33.77 262.15,-26.82 217.21,-22.32"/> -<polygon fill="black" stroke="black" points="217.59,-18.84 207.29,-21.32 216.89,-25.8 217.59,-18.84"/> -<text text-anchor="middle" x="270.38" y="-35.44" font-family="Times New Roman,serif" font-size="14.00">execute load first</text> +<path fill="none" stroke="#536477" stroke-width="1.5" stroke-dasharray="5,2" d="M339.24,-32C339.24,-32 243.79,-32 243.79,-32"/> +<polygon fill="#536477" stroke="#536477" stroke-width="1.5" points="243.79,-29.55 236.79,-32 243.79,-34.45 243.79,-29.55"/> +<text text-anchor="middle" x="257.02" y="-33.95" font-family="Helvetica,sans-Serif" font-size="9.00" fill="#364352">execute load first</text> </g> <!-- Y --> <g id="node4" class="node"> <title>Y</title> -<polygon fill="none" stroke="black" points="474.25,-113 335.25,-113 335.25,-77 474.25,-77 474.25,-113"/> -<text text-anchor="middle" x="404.75" y="-89.95" font-family="Times New Roman,serif" font-size="14.00">Store p.y: independent</text> +<polygon fill="#dcecff" stroke="#758191" points="461.52,-99.54 461.52,-114.46 406.68,-125 329.12,-125 274.27,-114.46 274.27,-99.54 329.12,-89 406.68,-89 461.52,-99.54"/> +<text text-anchor="middle" x="367.9" y="-102.72" font-family="Helvetica,sans-Serif" font-size="12.00" fill="#152330">Store p.y: independent</text> </g> </g> </svg> diff --git a/chapter10b/docs/lattice.gv b/chapter10b/docs/lattice.gv index f9fb2b09..a37a1738 100644 --- a/chapter10b/docs/lattice.gv +++ b/chapter10b/docs/lattice.gv @@ -69,7 +69,7 @@ digraph Lattice { STRUCT_BOT [label="⊥:struct\n[struct bottom]"]; STRUCT_PERSON [label="Person\nage: int", shape=box]; STRUCT_S1 [label="s1\nx: int", shape=box]; - STRUCT_S2 [label="s2\nx: int, y: *s1", shape=box]; + STRUCT_S2 [label="s2\nx: int, y: int", shape=box]; STRUCT_MORE [label="…", shape=box]; {rank=same; STRUCT_PERSON; STRUCT_S1; STRUCT_S2; STRUCT_MORE;} STRUCT_PERSON -> STRUCT_S1 -> STRUCT_S2 -> STRUCT_MORE [style=invis]; diff --git a/chapter10b/docs/lattice.svg b/chapter10b/docs/lattice.svg index a11452b9..ff554601 100644 --- a/chapter10b/docs/lattice.svg +++ b/chapter10b/docs/lattice.svg @@ -4,11 +4,11 @@ <!-- Generated by graphviz version 12.2.0 (20241103.1931) --> <!-- Title: Lattice Pages: 1 --> -<svg width="1827pt" height="533pt" - viewBox="0.00 0.00 1827.00 533.45" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<svg width="1823pt" height="533pt" + viewBox="0.00 0.00 1823.00 533.45" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 529.45)"> <title>Lattice</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-529.45 1823,-529.45 1823,4 -4,4"/> +<polygon fill="white" stroke="none" points="-4,4 -4,-529.45 1819,-529.45 1819,4 -4,4"/> <g id="clust1" class="cluster"> <title>cluster_control</title> <polygon fill="none" stroke="#cccccc" points="8,-85.99 8,-454.71 98,-454.71 98,-85.99 8,-85.99"/> @@ -26,21 +26,21 @@ </g> <g id="clust13" class="cluster"> <title>cluster_struct</title> -<polygon fill="none" stroke="#cccccc" points="901,-75 901,-481.45 1237,-481.45 1237,-75 901,-75"/> -<text text-anchor="middle" x="1069" y="-464.15" font-family="Arial" font-size="14.00">Struct</text> -<text text-anchor="middle" x="1069" y="-448.4" font-family="Arial" font-size="14.00">named collection of named scalar types</text> +<polygon fill="none" stroke="#cccccc" points="901,-75 901,-481.45 1233,-481.45 1233,-75 901,-75"/> +<text text-anchor="middle" x="1067" y="-464.15" font-family="Arial" font-size="14.00">Struct</text> +<text text-anchor="middle" x="1067" y="-448.4" font-family="Arial" font-size="14.00">named collection of named scalar types</text> </g> <g id="clust17" class="cluster"> <title>cluster_memory</title> -<polygon fill="none" stroke="#cccccc" points="1245,-85.99 1245,-470.46 1527,-470.46 1527,-85.99 1245,-85.99"/> -<text text-anchor="middle" x="1386" y="-453.16" font-family="Arial" font-size="14.00">Memory</text> -<text text-anchor="middle" x="1386" y="-437.41" font-family="Arial" font-size="14.00">precise alias slices</text> +<polygon fill="none" stroke="#cccccc" points="1241,-85.99 1241,-470.46 1523,-470.46 1523,-85.99 1241,-85.99"/> +<text text-anchor="middle" x="1382" y="-453.16" font-family="Arial" font-size="14.00">Memory</text> +<text text-anchor="middle" x="1382" y="-437.41" font-family="Arial" font-size="14.00">precise alias slices</text> </g> <g id="clust21" class="cluster"> <title>cluster_tuple</title> -<polygon fill="none" stroke="#cccccc" points="1535,-85.99 1535,-470.46 1811,-470.46 1811,-85.99 1535,-85.99"/> -<text text-anchor="middle" x="1673" y="-453.16" font-family="Arial" font-size="14.00">Tuple</text> -<text text-anchor="middle" x="1673" y="-437.41" font-family="Arial" font-size="14.00">collection of types</text> +<polygon fill="none" stroke="#cccccc" points="1531,-85.99 1531,-470.46 1807,-470.46 1807,-85.99 1531,-85.99"/> +<text text-anchor="middle" x="1669" y="-453.16" font-family="Arial" font-size="14.00">Tuple</text> +<text text-anchor="middle" x="1669" y="-437.41" font-family="Arial" font-size="14.00">collection of types</text> </g> <!-- TOP --> <g id="node1" class="node"> @@ -101,26 +101,26 @@ <!-- MEM_TOP --> <g id="node26" class="node"> <title>MEM_TOP</title> -<ellipse fill="#00008b" stroke="black" cx="1351" cy="-404.96" rx="44.7" ry="18"/> -<text text-anchor="middle" x="1351" y="-400.86" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:mem</text> +<ellipse fill="#00008b" stroke="black" cx="1347" cy="-404.96" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1347" y="-400.86" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:mem</text> </g> <!-- TOP->MEM_TOP --> <g id="edge64" class="edge"> <title>TOP->MEM_TOP</title> -<path fill="none" stroke="#555555" d="M914.33,-506.36C986.5,-505.84 1180.8,-502.47 1241,-481.45 1274.58,-469.72 1307.45,-444.9 1328.39,-426.91"/> -<polygon fill="#555555" stroke="#555555" points="1329.69,-428.56 1332.83,-423.03 1326.93,-425.4 1329.69,-428.56"/> +<path fill="none" stroke="#555555" d="M914.28,-506.34C985.84,-505.75 1177.55,-502.23 1237,-481.45 1270.57,-469.71 1303.45,-444.89 1324.38,-426.91"/> +<polygon fill="#555555" stroke="#555555" points="1325.69,-428.56 1328.82,-423.03 1322.92,-425.39 1325.69,-428.56"/> </g> <!-- TUPLE_TOP --> <g id="node31" class="node"> <title>TUPLE_TOP</title> -<ellipse fill="#ffc0cb" stroke="black" cx="1588" cy="-404.96" rx="44.7" ry="18"/> -<text text-anchor="middle" x="1588" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:tuple</text> +<ellipse fill="#ffc0cb" stroke="black" cx="1584" cy="-404.96" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1584" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:tuple</text> </g> <!-- TOP->TUPLE_TOP --> <g id="edge65" class="edge"> <title>TOP->TUPLE_TOP</title> -<path fill="none" stroke="#555555" d="M914.36,-506.76C1030.08,-507.88 1475.84,-510.27 1531,-481.45 1552.39,-470.27 1568.01,-447.05 1577.43,-429.3"/> -<polygon fill="#555555" stroke="#555555" points="1579.08,-430.68 1579.93,-424.38 1575.34,-428.78 1579.08,-430.68"/> +<path fill="none" stroke="#555555" d="M914.19,-506.75C1029.19,-507.83 1472.18,-510.1 1527,-481.45 1548.39,-470.27 1564,-447.05 1573.43,-429.3"/> +<polygon fill="#555555" stroke="#555555" points="1575.08,-430.68 1575.93,-424.38 1571.33,-428.78 1575.08,-430.68"/> </g> <!-- BOT --> <g id="node2" class="node"> @@ -416,27 +416,27 @@ <!-- STRUCT_S2 --> <g id="node24" class="node"> <title>STRUCT_S2</title> -<polygon fill="#90ee90" stroke="black" points="1159.12,-237.47 1062.88,-237.47 1062.88,-196.47 1159.12,-196.47 1159.12,-237.47"/> -<text text-anchor="middle" x="1111" y="-221.12" font-family="DejaVu Sans" font-size="13.00">s2</text> -<text text-anchor="middle" x="1111" y="-204.62" font-family="DejaVu Sans" font-size="13.00">x: int, y: *s1</text> +<polygon fill="#90ee90" stroke="black" points="1154.88,-237.47 1063.12,-237.47 1063.12,-196.47 1154.88,-196.47 1154.88,-237.47"/> +<text text-anchor="middle" x="1109" y="-221.12" font-family="DejaVu Sans" font-size="13.00">s2</text> +<text text-anchor="middle" x="1109" y="-204.62" font-family="DejaVu Sans" font-size="13.00">x: int, y: int</text> </g> <!-- STRUCT_TOP->STRUCT_S2 --> <g id="edge38" class="edge"> <title>STRUCT_TOP->STRUCT_S2</title> -<path fill="none" stroke="#555555" d="M1033.43,-376.51C1050.81,-340.99 1080.89,-279.5 1098.04,-244.46"/> -<polygon fill="#555555" stroke="#555555" points="1099.88,-245.49 1100.63,-239.17 1096.1,-243.64 1099.88,-245.49"/> +<path fill="none" stroke="#555555" d="M1033.32,-376.11C1050.37,-340.49 1079.69,-279.23 1096.39,-244.33"/> +<polygon fill="#555555" stroke="#555555" points="1098.2,-245.4 1098.9,-239.09 1094.41,-243.59 1098.2,-245.4"/> </g> <!-- STRUCT_MORE --> <g id="node25" class="node"> <title>STRUCT_MORE</title> -<polygon fill="#90ee90" stroke="black" points="1229,-234.97 1175,-234.97 1175,-198.97 1229,-198.97 1229,-234.97"/> -<text text-anchor="middle" x="1202" y="-212.87" font-family="DejaVu Sans" font-size="13.00">…</text> +<polygon fill="#90ee90" stroke="black" points="1225,-234.97 1171,-234.97 1171,-198.97 1225,-198.97 1225,-234.97"/> +<text text-anchor="middle" x="1198" y="-212.87" font-family="DejaVu Sans" font-size="13.00">…</text> </g> <!-- STRUCT_TOP->STRUCT_MORE --> <g id="edge39" class="edge"> <title>STRUCT_TOP->STRUCT_MORE</title> -<path fill="none" stroke="#555555" d="M1045.31,-378.1C1081.09,-341.53 1145.91,-275.3 1179.87,-240.58"/> -<polygon fill="#555555" stroke="#555555" points="1181.3,-242.13 1183.99,-236.38 1178.3,-239.19 1181.3,-242.13"/> +<path fill="none" stroke="#555555" d="M1044.75,-378.1C1079.75,-341.53 1143.14,-275.3 1176.36,-240.58"/> +<polygon fill="#555555" stroke="#555555" points="1177.75,-242.17 1180.38,-236.39 1174.71,-239.27 1177.75,-242.17"/> </g> <!-- STRUCT_TOP->MEM_TOP --> <!-- STRUCT_BOT --> @@ -469,152 +469,152 @@ <!-- STRUCT_S2->STRUCT_BOT --> <g id="edge42" class="edge"> <title>STRUCT_S2->STRUCT_BOT</title> -<path fill="none" stroke="#555555" d="M1093.45,-196.12C1080.83,-181.83 1063.53,-162.25 1048.88,-145.68"/> -<polygon fill="#555555" stroke="#555555" points="1050.58,-144.42 1045.03,-141.32 1047.43,-147.2 1050.58,-144.42"/> +<path fill="none" stroke="#555555" d="M1091.84,-196.12C1079.5,-181.83 1062.57,-162.25 1048.25,-145.68"/> +<polygon fill="#555555" stroke="#555555" points="1050,-144.5 1044.49,-141.33 1046.82,-147.24 1050,-144.5"/> </g> <!-- STRUCT_S2->STRUCT_MORE --> <!-- STRUCT_MORE->STRUCT_BOT --> <g id="edge43" class="edge"> <title>STRUCT_MORE->STRUCT_BOT</title> -<path fill="none" stroke="#555555" d="M1181.79,-198.68C1177.07,-194.96 1171.97,-191.19 1167,-187.98 1138.36,-169.5 1104.6,-152 1076.65,-138.56"/> -<polygon fill="#555555" stroke="#555555" points="1077.74,-136.75 1071.42,-136.06 1075.93,-140.54 1077.74,-136.75"/> +<path fill="none" stroke="#555555" d="M1177.76,-198.72C1173.05,-195 1167.95,-191.22 1163,-187.98 1135.19,-169.81 1102.49,-152.39 1075.38,-138.93"/> +<polygon fill="#555555" stroke="#555555" points="1076.64,-137.21 1070.33,-136.44 1074.78,-140.97 1076.64,-137.21"/> </g> <!-- MEM_ALIAS2 --> <g id="node28" class="node"> <title>MEM_ALIAS2</title> -<ellipse fill="#00008b" stroke="black" cx="1298" cy="-216.97" rx="45.21" ry="18"/> -<text text-anchor="middle" x="1298" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#2</text> +<ellipse fill="#00008b" stroke="black" cx="1294" cy="-216.97" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1294" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#2</text> </g> <!-- MEM_TOP->MEM_ALIAS2 --> <g id="edge46" class="edge"> <title>MEM_TOP->MEM_ALIAS2</title> -<path fill="none" stroke="#555555" d="M1346.11,-386.79C1336.64,-353.58 1315.8,-280.42 1304.92,-242.24"/> -<polygon fill="#555555" stroke="#555555" points="1306.96,-241.75 1303.29,-236.55 1302.92,-242.9 1306.96,-241.75"/> +<path fill="none" stroke="#555555" d="M1342.11,-386.79C1332.64,-353.58 1311.8,-280.42 1300.92,-242.24"/> +<polygon fill="#555555" stroke="#555555" points="1302.96,-241.75 1299.29,-236.55 1298.92,-242.9 1302.96,-241.75"/> </g> <!-- MEM_ALIAS3 --> <g id="node29" class="node"> <title>MEM_ALIAS3</title> -<ellipse fill="#00008b" stroke="black" cx="1404" cy="-216.97" rx="45.21" ry="18"/> -<text text-anchor="middle" x="1404" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#3</text> +<ellipse fill="#00008b" stroke="black" cx="1400" cy="-216.97" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1400" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#3</text> </g> <!-- MEM_TOP->MEM_ALIAS3 --> <g id="edge47" class="edge"> <title>MEM_TOP->MEM_ALIAS3</title> -<path fill="none" stroke="#555555" d="M1355.89,-386.79C1365.36,-353.58 1386.2,-280.42 1397.08,-242.24"/> -<polygon fill="#555555" stroke="#555555" points="1399.08,-242.9 1398.71,-236.55 1395.04,-241.75 1399.08,-242.9"/> +<path fill="none" stroke="#555555" d="M1351.89,-386.79C1361.36,-353.58 1382.2,-280.42 1393.08,-242.24"/> +<polygon fill="#555555" stroke="#555555" points="1395.08,-242.9 1394.71,-236.55 1391.04,-241.75 1395.08,-242.9"/> </g> <!-- MEM_MORE --> <g id="node30" class="node"> <title>MEM_MORE</title> -<ellipse fill="#00008b" stroke="black" cx="1492" cy="-216.97" rx="27" ry="18"/> -<text text-anchor="middle" x="1492" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">…</text> +<ellipse fill="#00008b" stroke="black" cx="1488" cy="-216.97" rx="27" ry="18"/> +<text text-anchor="middle" x="1488" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">…</text> </g> <!-- MEM_TOP->MEM_MORE --> <g id="edge48" class="edge"> <title>MEM_TOP->MEM_MORE</title> -<path fill="none" stroke="#555555" d="M1363.51,-387.45C1389.1,-353.7 1447.4,-276.8 1475.82,-239.32"/> -<polygon fill="#555555" stroke="#555555" points="1477.25,-240.91 1479.2,-234.86 1473.9,-238.37 1477.25,-240.91"/> +<path fill="none" stroke="#555555" d="M1359.51,-387.45C1385.1,-353.7 1443.4,-276.8 1471.82,-239.32"/> +<polygon fill="#555555" stroke="#555555" points="1473.25,-240.91 1475.2,-234.86 1469.9,-238.37 1473.25,-240.91"/> </g> <!-- MEM_TOP->TUPLE_TOP --> <!-- MEM_BOT --> <g id="node27" class="node"> <title>MEM_BOT</title> -<ellipse fill="#00008b" stroke="black" cx="1351" cy="-111.99" rx="44.7" ry="18"/> -<text text-anchor="middle" x="1351" y="-107.89" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥:mem</text> +<ellipse fill="#00008b" stroke="black" cx="1347" cy="-111.99" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1347" y="-107.89" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥:mem</text> </g> <!-- MEM_BOT->BOT --> <g id="edge70" class="edge"> <title>MEM_BOT->BOT</title> -<path fill="none" stroke="#555555" d="M1319.14,-99.06C1297.39,-91.29 1267.77,-81.43 1241,-75 1124.06,-46.89 982.06,-29.48 918.11,-22.5"/> -<polygon fill="#555555" stroke="#555555" points="918.4,-20.42 912.21,-21.87 917.95,-24.6 918.4,-20.42"/> +<path fill="none" stroke="#555555" d="M1315.14,-99.08C1293.38,-91.31 1263.76,-81.46 1237,-75 1121.65,-47.17 981.66,-29.67 918.21,-22.6"/> +<polygon fill="#555555" stroke="#555555" points="918.55,-20.52 912.36,-21.95 918.09,-24.7 918.55,-20.52"/> </g> <!-- MEM_ALIAS2->MEM_BOT --> <g id="edge49" class="edge"> <title>MEM_ALIAS2->MEM_BOT</title> -<path fill="none" stroke="#555555" d="M1306.75,-198.97C1315.5,-181.97 1329.02,-155.71 1338.81,-136.68"/> -<polygon fill="#555555" stroke="#555555" points="1340.66,-137.66 1341.54,-131.37 1336.93,-135.74 1340.66,-137.66"/> +<path fill="none" stroke="#555555" d="M1302.75,-198.97C1311.5,-181.97 1325.02,-155.71 1334.81,-136.68"/> +<polygon fill="#555555" stroke="#555555" points="1336.66,-137.66 1337.54,-131.37 1332.93,-135.74 1336.66,-137.66"/> </g> <!-- MEM_ALIAS2->MEM_ALIAS3 --> <!-- MEM_ALIAS3->MEM_BOT --> <g id="edge50" class="edge"> <title>MEM_ALIAS3->MEM_BOT</title> -<path fill="none" stroke="#555555" d="M1395.25,-198.97C1386.5,-181.97 1372.98,-155.71 1363.19,-136.68"/> -<polygon fill="#555555" stroke="#555555" points="1365.07,-135.74 1360.46,-131.37 1361.34,-137.66 1365.07,-135.74"/> +<path fill="none" stroke="#555555" d="M1391.25,-198.97C1382.5,-181.97 1368.98,-155.71 1359.19,-136.68"/> +<polygon fill="#555555" stroke="#555555" points="1361.07,-135.74 1356.46,-131.37 1357.34,-137.66 1361.07,-135.74"/> </g> <!-- MEM_ALIAS3->MEM_MORE --> <!-- MEM_MORE->MEM_BOT --> <g id="edge51" class="edge"> <title>MEM_MORE->MEM_BOT</title> -<path fill="none" stroke="#555555" d="M1475.42,-202.39C1469.65,-197.74 1463.09,-192.57 1457,-187.98 1430.93,-168.37 1400.47,-146.96 1378.9,-132.06"/> -<polygon fill="#555555" stroke="#555555" points="1380.17,-130.38 1374.03,-128.71 1377.78,-133.84 1380.17,-130.38"/> +<path fill="none" stroke="#555555" d="M1471.42,-202.39C1465.65,-197.74 1459.09,-192.57 1453,-187.98 1426.93,-168.37 1396.47,-146.96 1374.9,-132.06"/> +<polygon fill="#555555" stroke="#555555" points="1376.17,-130.38 1370.03,-128.71 1373.78,-133.84 1376.17,-130.38"/> </g> <!-- TUPLE1 --> <g id="node33" class="node"> <title>TUPLE1</title> -<polygon fill="#ffc0cb" stroke="black" points="1598.88,-328.97 1543.12,-328.97 1543.12,-292.97 1598.88,-292.97 1598.88,-328.97"/> -<text text-anchor="middle" x="1571" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type)</text> +<polygon fill="#ffc0cb" stroke="black" points="1594.88,-328.97 1539.12,-328.97 1539.12,-292.97 1594.88,-292.97 1594.88,-328.97"/> +<text text-anchor="middle" x="1567" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type)</text> </g> <!-- TUPLE_TOP->TUPLE1 --> <g id="edge54" class="edge"> <title>TUPLE_TOP->TUPLE1</title> -<path fill="none" stroke="#555555" d="M1584.8,-386.65C1582.19,-372.52 1578.47,-352.37 1575.54,-336.56"/> -<polygon fill="#555555" stroke="#555555" points="1577.61,-336.2 1574.46,-330.68 1573.48,-336.96 1577.61,-336.2"/> +<path fill="none" stroke="#555555" d="M1580.8,-386.65C1578.19,-372.52 1574.47,-352.37 1571.54,-336.56"/> +<polygon fill="#555555" stroke="#555555" points="1573.61,-336.2 1570.46,-330.68 1569.48,-336.96 1573.61,-336.2"/> </g> <!-- TUPLE2 --> <g id="node34" class="node"> <title>TUPLE2</title> -<polygon fill="#ffc0cb" stroke="black" points="1709,-328.97 1615,-328.97 1615,-292.97 1709,-292.97 1709,-328.97"/> -<text text-anchor="middle" x="1662" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, type)</text> +<polygon fill="#ffc0cb" stroke="black" points="1705,-328.97 1611,-328.97 1611,-292.97 1705,-292.97 1705,-328.97"/> +<text text-anchor="middle" x="1658" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, type)</text> </g> <!-- TUPLE_TOP->TUPLE2 --> <g id="edge55" class="edge"> <title>TUPLE_TOP->TUPLE2</title> -<path fill="none" stroke="#555555" d="M1601.23,-387.51C1613,-372.87 1630.35,-351.31 1643.5,-334.97"/> -<polygon fill="#555555" stroke="#555555" points="1645.06,-336.38 1647.18,-330.39 1641.79,-333.74 1645.06,-336.38"/> +<path fill="none" stroke="#555555" d="M1597.23,-387.51C1609,-372.87 1626.35,-351.31 1639.5,-334.97"/> +<polygon fill="#555555" stroke="#555555" points="1641.06,-336.38 1643.18,-330.39 1637.79,-333.74 1641.06,-336.38"/> </g> <!-- TUPLEN --> <g id="node35" class="node"> <title>TUPLEN</title> -<polygon fill="#ffc0cb" stroke="black" points="1802.75,-328.97 1725.25,-328.97 1725.25,-292.97 1802.75,-292.97 1802.75,-328.97"/> -<text text-anchor="middle" x="1764" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, …)</text> +<polygon fill="#ffc0cb" stroke="black" points="1798.75,-328.97 1721.25,-328.97 1721.25,-292.97 1798.75,-292.97 1798.75,-328.97"/> +<text text-anchor="middle" x="1760" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, …)</text> </g> <!-- TUPLE_TOP->TUPLEN --> <g id="edge56" class="edge"> <title>TUPLE_TOP->TUPLEN</title> -<path fill="none" stroke="#555555" d="M1614.35,-390.18C1643.39,-375.01 1690.42,-350.42 1724.01,-332.87"/> -<polygon fill="#555555" stroke="#555555" points="1724.85,-334.8 1729.2,-330.16 1722.91,-331.07 1724.85,-334.8"/> +<path fill="none" stroke="#555555" d="M1610.35,-390.18C1639.39,-375.01 1686.42,-350.42 1720.01,-332.87"/> +<polygon fill="#555555" stroke="#555555" points="1720.85,-334.8 1725.2,-330.16 1718.91,-331.07 1720.85,-334.8"/> </g> <!-- TUPLE_BOT --> <g id="node32" class="node"> <title>TUPLE_BOT</title> -<ellipse fill="#ffc0cb" stroke="black" cx="1625" cy="-111.99" rx="44.7" ry="18"/> -<text text-anchor="middle" x="1625" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:tuple</text> +<ellipse fill="#ffc0cb" stroke="black" cx="1621" cy="-111.99" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1621" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:tuple</text> </g> <!-- TUPLE_BOT->BOT --> <g id="edge71" class="edge"> <title>TUPLE_BOT->BOT</title> -<path fill="none" stroke="#555555" d="M1596.44,-97.66C1578.14,-89.72 1553.65,-80.21 1531,-75 1301.56,-22.24 1015.96,-18.29 918.46,-18.63"/> -<polygon fill="#555555" stroke="#555555" points="918.73,-16.53 912.74,-18.66 918.75,-20.73 918.73,-16.53"/> +<path fill="none" stroke="#555555" d="M1592.44,-97.66C1574.14,-89.72 1549.65,-80.21 1527,-75 1299.48,-22.62 1016.37,-18.41 918.88,-18.65"/> +<polygon fill="#555555" stroke="#555555" points="918.88,-16.55 912.89,-18.68 918.89,-20.75 918.88,-16.55"/> </g> <!-- TUPLE1->TUPLE_BOT --> <g id="edge57" class="edge"> <title>TUPLE1->TUPLE_BOT</title> -<path fill="none" stroke="#555555" d="M1575.79,-292.49C1585.46,-257.21 1607.33,-177.44 1618.37,-137.19"/> -<polygon fill="#555555" stroke="#555555" points="1620.33,-137.95 1619.9,-131.61 1616.28,-136.84 1620.33,-137.95"/> +<path fill="none" stroke="#555555" d="M1571.79,-292.49C1581.46,-257.21 1603.33,-177.44 1614.37,-137.19"/> +<polygon fill="#555555" stroke="#555555" points="1616.33,-137.95 1615.9,-131.61 1612.28,-136.84 1616.33,-137.95"/> </g> <!-- TUPLE1->TUPLE2 --> <!-- TUPLE2->TUPLE_BOT --> <g id="edge58" class="edge"> <title>TUPLE2->TUPLE_BOT</title> -<path fill="none" stroke="#555555" d="M1658.72,-292.49C1652.12,-257.37 1637.24,-178.17 1629.65,-137.74"/> -<polygon fill="#555555" stroke="#555555" points="1631.73,-137.43 1628.56,-131.92 1627.6,-138.2 1631.73,-137.43"/> +<path fill="none" stroke="#555555" d="M1654.72,-292.49C1648.12,-257.37 1633.24,-178.17 1625.65,-137.74"/> +<polygon fill="#555555" stroke="#555555" points="1627.73,-137.43 1624.56,-131.92 1623.6,-138.2 1627.73,-137.43"/> </g> <!-- TUPLE2->TUPLEN --> <!-- TUPLEN->TUPLE_BOT --> <g id="edge59" class="edge"> <title>TUPLEN->TUPLE_BOT</title> -<path fill="none" stroke="#555555" d="M1751.66,-292.49C1726.44,-256.74 1668.97,-175.3 1640.95,-135.59"/> -<polygon fill="#555555" stroke="#555555" points="1642.76,-134.52 1637.59,-130.83 1639.33,-136.94 1642.76,-134.52"/> +<path fill="none" stroke="#555555" d="M1747.66,-292.49C1722.44,-256.74 1664.97,-175.3 1636.95,-135.59"/> +<polygon fill="#555555" stroke="#555555" points="1638.76,-134.52 1633.59,-130.83 1635.33,-136.94 1638.76,-134.52"/> </g> </g> </svg> diff --git a/chapter11/README.md b/chapter11/README.md index b91f4fd7..58adbbfb 100644 --- a/chapter11/README.md +++ b/chapter11/README.md @@ -1,5 +1,8 @@ # Chapter 11: Global Code Motion +[Previous: Chapter 10b](../chapter10b/README.md) | +[Next: Chapter 12](../chapter12/README.md) + This chapter schedules the memory representation introduced in [10b](../chapter10b/README.md): one parser-visible `$mem`, with `MemMerge`, `MemPhi`, and `BulkMemPhi` recovering independent field chains. Start supplies @@ -20,7 +23,7 @@ their Region, just like scalar Phis. 1. [High Level Overview](#high-level-overview) 2. [Scheduling Walk Through](#scheduling-walk-through) 3. [Scheduling a Loop](#scheduling-a-loop) -4. [Components of the Global Code Motion Algorithm ](#components-of-the-global-code-motion-algorithm) +4. [Components of the Global Code Motion Algorithm](#components-of-the-global-code-motion-algorithm) 5. [Identification of Basic Blocks in SoN graph](#identification-of-basic-blocks-in-son-graph) 6. [Handling Infinite Loops](#handling-infinite-loops) 7. [Dominators](#dominators) @@ -30,13 +33,12 @@ their Region, just like scalar Phis. 11. [Inserting Anti Dependencies](#inserting-anti-dependencies) 12. [Video Walk Through](#video-walk-through) - You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter11) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter10b...linear-chapter11) it to the previous chapter. The original input source program defines a sequence in which things happen. As we parse the program into Sea of Nodes representation and perform various optimizations, this sequence is not fully maintained. The optimized Sea of Nodes graph is driven more -by dependencies between nodes rather that the sequence of instructions in the original source program. +by dependencies between nodes rather than the sequence of instructions in the original source program. Our goal in this chapter is to look at how we can recover a schedule for executing instructions from an optimized Sea of Nodes graph. This schedule needs to preserve the semantics of the original source program, @@ -85,7 +87,7 @@ if (arg) v.f=1; return i; ``` -First lets look at the graph before scheduling. +First let's look at the graph before scheduling. These walkthrough diagrams show the precise `S.f` chain and the final MemMerge consumed by Return. The unchanged default memory comes from Start; @@ -100,13 +102,13 @@ Observe that * Ditto for Phi nodes which are attached to the Region nodes. * So what remains are the "floating" Data nodes that do not have a control input at this stage. In this example, these are the load `.f` and store `.f=` nodes. -Now, lets look at the graph after we run the early schedule. +Now, let's look at the graph after we run the early schedule.  * Observe that the load `.f` and the stores `.f=` now have control edges to the `$ctrl` projection from Start. Thus, the early schedule has put the Data nodes in the first basic block. -* This is because the inputs to these nodes are have the `$ctrl` projection as the immediate dominator. +* This is because the inputs to these nodes have the `$ctrl` projection as the immediate dominator. The graph below shows the schedule post late scheduling. @@ -114,7 +116,7 @@ The graph below shows the schedule post late scheduling. The snip below shows the main changes in the graph: - + * The store `.f=` now has an anti-dependency on the load `.f`; this ensures that the store is scheduled after the load, as required by program semantics. We discuss anti-dependencies in detail later. * Observe also that the store `.f=` is now bound to the True branch of the If node. @@ -168,7 +170,7 @@ We have already alluded to several components of the GCM algorithm in passing ab ## Identification of Basic Blocks in SoN graph -The Sea of Nodes graph already captures the programs control flow graph. This information is implicit in the control nodes and edges from control nodes to other types of nodes. +The Sea of Nodes graph already captures the program's control flow graph. This information is implicit in the control nodes and edges from control nodes to other types of nodes. To recap, Control starts at the Start node, via a projection that is bound to the name `$ctrl`. As the control flows in the program, this name binding gets updated, and control is passed around, until it reaches the Stop node. @@ -204,7 +206,7 @@ while (1) {} return 0; ``` -First lets look at the graph resulting from this: +First let's look at the graph resulting from this:  @@ -218,7 +220,7 @@ The implementation is in the Loop node: // If this is an unreachable loop, it may not have an exit. If it does not // (i.e., infinite loop), force an exit to make it reachable. public void forceExit( StopNode stop ) { - // Walk the backedge, then immediate dominator tree util we hit this + // Walk the backedge, then immediate dominator tree until we hit this // Loop again. If we ever hit a CProj from an If (as opposed to // directly on the If) we found our exit. CFGNode x = back(); @@ -332,7 +334,7 @@ class StopNode extends CFGNode { Simple's Sea of Nodes graph identifies loops explicitly via Loop nodes. Since the language provides a single way to create a loop, using the `while` statement, it is not necessary to implement a generic loop discovery process. -We do however need to compute a loop depth. This is done similar to how we compute the dominator depth. +We do however need to compute a loop depth. This is done similarly to how we compute the dominator depth. ```java class CFGNode { @@ -374,7 +376,7 @@ class StopNode extends CFGNode { ## Early Schedule -The GCM algorithm proper starts with the computation of the early schedule, during which do an upward DFS walk on the "inputs" of each Node, starting from the bottom (Stop). We schedule each data node to the +The GCM algorithm proper starts with the computation of the early schedule, during which we do an upward DFS walk on the "inputs" of each Node, starting from the bottom (Stop). We schedule each data node to the first control block where they are dominated by their inputs. A pre-condition of this is to ensure that infinite loops have been "fixed" as described earlier. diff --git a/chapter11/docs/Makefile b/chapter11/docs/Makefile index 055882b2..6fa0f057 100644 --- a/chapter11/docs/Makefile +++ b/chapter11/docs/Makefile @@ -1,14 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) -.DELETE_ON_ERROR: - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - @sed -i 's/\r$$//' $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter11/docs/graph1.json b/chapter11/docs/graph1.json new file mode 100644 index 00000000..748bdae9 --- /dev/null +++ b/chapter11/docs/graph1.json @@ -0,0 +1,33 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph1.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 224, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 1}}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 23, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "CTRL", "label": null}, {"idx": 2, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 23, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 224, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 23, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + {"id": 17, "par": 0, "nodes": [8, 10, 17, 22, 23, 224]} + ] +} diff --git a/chapter11/docs/graph1.svg b/chapter11/docs/graph1.svg index 422d790e..ef4d0293 100644 --- a/chapter11/docs/graph1.svg +++ b/chapter11/docs/graph1.svg @@ -1,306 +1,151 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="346pt" height="714pt" - viewBox="0.00 0.00 346.00 714.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 710)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-710 342,-710 342,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-698 330,-698 330,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="207.38,-659.5 207.38,-686 312.62,-686 312.62,-659.5 207.38,-659.5"/> -<polygon fill="none" stroke="black" points="207.38,-659.5 207.38,-686 312.62,-686 312.62,-659.5 207.38,-659.5"/> -<text text-anchor="start" x="247.25" y="-667.7" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="207.38,-627 207.38,-659.5 312.62,-659.5 312.62,-627 207.38,-627"/> -<polygon fill="yellow" stroke="none" points="212.38,-632 212.38,-654.5 243.12,-654.5 243.12,-632 212.38,-632"/> -<polygon fill="none" stroke="black" points="212.38,-632 212.38,-654.5 243.12,-654.5 243.12,-632 212.38,-632"/> -<text text-anchor="start" x="215.38" y="-638.2" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="243.12,-632 243.12,-654.5 284.38,-654.5 284.38,-632 243.12,-632"/> -<text text-anchor="start" x="246.12" y="-638.2" font-family="Times New Roman,serif" font-size="14.00">$mem</text> -<polygon fill="none" stroke="black" points="284.38,-632 284.38,-654.5 307.62,-654.5 307.62,-632 284.38,-632"/> -<text text-anchor="start" x="287.38" y="-638.2" font-family="Times New Roman,serif" font-size="14.00">arg</text> -</g> -<!-- MemMerge --> -<g id="node2" class="node"> -<title>MemMerge</title> -<polygon fill="none" stroke="black" points="195,-196 113,-196 113,-160 195,-160 195,-196"/> -<text text-anchor="middle" x="154" y="-172.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> -</g> -<!-- MemMerge->Start2 --> -<g id="edge25" class="edge"> -<title>MemMerge->Start2:p1</title> -<path fill="none" stroke="blue" d="M174.24,-196.05C184.06,-205.56 195.02,-218.24 201,-232 238.55,-318.39 196.42,-352.07 221,-443 234.8,-494.06 259.62,-499.34 271,-551 277.81,-581.92 266.84,-592.84 264.27,-619.8"/> -<polygon fill="blue" stroke="blue" points="260.79,-619.34 263.82,-629.49 267.78,-619.66 260.79,-619.34"/> -<text text-anchor="middle" x="171.99" y="-198.2" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_224 --> -<g id="node15" class="node"> -<title>Phi_224</title> -<ellipse fill="lightyellow" stroke="black" cx="139" cy="-250" rx="52.89" ry="18"/> -<text text-anchor="middle" x="139" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- MemMerge->Phi_224 --> -<g id="edge26" class="edge"> -<title>MemMerge->Phi_224</title> -<path fill="none" stroke="blue" d="M150.29,-196.3C148.71,-203.68 146.83,-212.48 145.05,-220.75"/> -<polygon fill="blue" stroke="blue" points="141.66,-219.9 142.98,-230.42 148.5,-221.37 141.66,-219.9"/> -<text text-anchor="middle" x="148.04" y="-198.45" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="181,-52 127,-52 127,-16 181,-16 181,-52"/> -<text text-anchor="middle" x="154" y="-28.95" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return25 --> -<g id="node16" class="node"> -<title>Return25</title> -<polygon fill="yellow" stroke="black" points="181,-124 127,-124 127,-88 181,-88 181,-124"/> -<text text-anchor="middle" x="154" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return25 --> -<g id="edge1" class="edge"> -<title>Stop3->Return25</title> -<path fill="none" stroke="red" d="M154,-52.3C154,-59.59 154,-68.27 154,-76.46"/> -<polygon fill="red" stroke="red" points="150.5,-76.38 154,-86.38 157.5,-76.38 150.5,-76.38"/> -<text text-anchor="middle" x="151.75" y="-54.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="93" cy="-497" rx="27" ry="18"/> -<text text-anchor="middle" x="93" y="-491.95" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- new9 --> -<g id="node5" class="node"> -<title>new9</title> -<ellipse fill="none" stroke="black" cx="50" cy="-569" rx="33.95" ry="18"/> -<text text-anchor="middle" x="50" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new9->Start2 --> -<g id="edge2" class="edge"> -<title>new9->Start2:p0</title> -<path fill="none" stroke="green" d="M68.15,-584.47C94.9,-604.4 147.46,-638.35 200.14,-642.77"/> -<polygon fill="green" stroke="green" points="199.72,-646.26 209.86,-643.19 200.02,-639.26 199.72,-646.26"/> -<text text-anchor="middle" x="70.4" y="-586.62" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_11 --> -<g id="node6" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="black" cx="149" cy="-569" rx="27" ry="18"/> -<text text-anchor="middle" x="149" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">#2</text> -</g> -<!-- Store12 --> -<g id="node7" class="node"> -<title>Store12</title> -<ellipse fill="none" stroke="black" cx="165" cy="-497" rx="27" ry="18"/> -<text text-anchor="middle" x="165" y="-491.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store12->Start2 --> -<g id="edge3" class="edge"> -<title>Store12->Start2:p1</title> -<path fill="none" stroke="blue" d="M147.77,-510.96C126.13,-528.81 94,-561.66 113,-587 152.26,-639.35 250.4,-570.87 262.52,-619.62"/> -<polygon fill="blue" stroke="blue" points="259.03,-619.93 263.59,-629.5 265.99,-619.18 259.03,-619.93"/> -<text text-anchor="middle" x="145.52" y="-513.11" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store12->new9 --> -<g id="edge4" class="edge"> -<title>Store12->new9</title> -<path fill="none" stroke="black" d="M145.49,-509.87C127.95,-520.55 101.87,-536.43 81.39,-548.89"/> -<polygon fill="black" stroke="black" points="79.58,-545.9 72.86,-554.09 83.22,-551.88 79.58,-545.9"/> -<text text-anchor="middle" x="147.74" y="-502.27" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store12->Con_11 --> -<g id="edge5" class="edge"> -<title>Store12->Con_11</title> -<path fill="none" stroke="black" d="M161.04,-515.3C159.36,-522.68 157.35,-531.48 155.46,-539.75"/> -<polygon fill="black" stroke="black" points="152.06,-538.89 153.25,-549.42 158.89,-540.45 152.06,-538.89"/> -<text text-anchor="middle" x="158.79" y="-517.45" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- new13 --> -<g id="node8" class="node"> -<title>new13</title> -<ellipse fill="none" stroke="black" cx="228" cy="-569" rx="33.95" ry="18"/> -<text text-anchor="middle" x="228" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new13->Start2 --> -<g id="edge6" class="edge"> -<title>new13->Start2:p0</title> -<path fill="none" stroke="green" d="M227.89,-587.35C227.84,-596.51 227.79,-608.2 227.76,-619.69"/> -<polygon fill="green" stroke="green" points="224.26,-619.48 227.75,-629.49 231.26,-619.49 224.26,-619.48"/> -<text text-anchor="middle" x="225.64" y="-589.5" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store14 --> -<g id="node9" class="node"> -<title>Store14</title> -<ellipse fill="none" stroke="black" cx="93" cy="-409.5" rx="27" ry="18"/> -<text text-anchor="middle" x="93" y="-404.45" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store14->Con_4 --> -<g id="edge9" class="edge"> -<title>Store14->Con_4</title> -<path fill="none" stroke="black" d="M93,-427.8C93,-439.16 93,-454.28 93,-467.4"/> -<polygon fill="black" stroke="black" points="89.5,-467.21 93,-477.21 96.5,-467.21 89.5,-467.21"/> -<text text-anchor="middle" x="90.75" y="-429.95" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store14->Store12 --> -<g id="edge7" class="edge"> -<title>Store14->Store12</title> -<path fill="none" stroke="blue" d="M105.87,-425.79C116.73,-438.67 132.44,-457.34 144.94,-472.18"/> -<polygon fill="blue" stroke="blue" points="142.15,-474.29 151.26,-479.69 147.5,-469.79 142.15,-474.29"/> -<text text-anchor="middle" x="103.62" y="-427.94" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store14->new13 --> -<g id="edge8" class="edge"> -<title>Store14->new13</title> -<path fill="none" stroke="black" d="M107.31,-425.06C113.63,-431.04 121.35,-437.78 129,-443 158.55,-463.17 177.93,-451.66 201,-479 215.33,-495.99 222.06,-520.44 225.21,-539.41"/> -<polygon fill="black" stroke="black" points="221.73,-539.76 226.58,-549.18 228.66,-538.79 221.73,-539.76"/> -<text text-anchor="middle" x="109.56" y="-427.21" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Load16 --> -<g id="node10" class="node"> -<title>Load16</title> -<ellipse fill="none" stroke="black" cx="43" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-316.95" font-family="Times New Roman,serif" font-size="14.00">.f</text> -</g> -<!-- Load16->new9 --> -<g id="edge11" class="edge"> -<title>Load16->new9</title> -<path fill="none" stroke="black" d="M47,-410.5C36.94,-454.72 41.17,-507.73 45.4,-539.6"/> -<polygon fill="black" stroke="black" points="41.89,-539.81 46.78,-549.21 48.82,-538.82 41.89,-539.81"/> -<path fill="none" stroke="black" d="M46.72,-340.02C49.87,-357.49 53,-385.34 47,-408.5"/> -<text text-anchor="middle" x="44.75" y="-402.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Load16->Store14 --> -<g id="edge10" class="edge"> -<title>Load16->Store14</title> -<path fill="none" stroke="blue" d="M52.4,-339.08C59.55,-351.3 69.53,-368.37 77.81,-382.52"/> -<polygon fill="blue" stroke="blue" points="74.63,-384.03 82.7,-390.89 80.68,-380.49 74.63,-384.03"/> -<text text-anchor="middle" x="50.15" y="-341.23" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If17 --> -<g id="node11" class="node"> -<title>If17</title> -<polygon fill="yellow" stroke="none" points="238,-412.5 238,-439 314,-439 314,-412.5 238,-412.5"/> -<polygon fill="none" stroke="black" points="238,-412.5 238,-439 314,-439 314,-412.5 238,-412.5"/> -<text text-anchor="start" x="271.5" y="-420.7" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="238,-380 238,-412.5 314,-412.5 314,-380 238,-380"/> -<polygon fill="yellow" stroke="none" points="243,-385 243,-407.5 274.5,-407.5 274.5,-385 243,-385"/> -<polygon fill="none" stroke="black" points="243,-385 243,-407.5 274.5,-407.5 274.5,-385 243,-385"/> -<text text-anchor="start" x="246" y="-391.2" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="274.5,-385 274.5,-407.5 309,-407.5 309,-385 274.5,-385"/> -<polygon fill="none" stroke="black" points="274.5,-385 274.5,-407.5 309,-407.5 309,-385 274.5,-385"/> -<text text-anchor="start" x="277.5" y="-391.2" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If17->Start2 --> -<g id="edge12" class="edge"> -<title>If17->Start2:p0</title> -<path fill="none" stroke="red" d="M301,-498C306.79,-539.34 292.85,-551.43 271,-587 261.11,-603.09 244.32,-604.88 234.83,-613.4"/> -<polygon fill="red" stroke="red" points="231.88,-611.53 229.53,-621.86 237.81,-615.25 231.88,-611.53"/> -<path fill="none" stroke="red" d="M287.84,-442.9C293,-458.69 298.44,-478.09 301,-496"/> -<text text-anchor="middle" x="298.75" y="-490.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If17->Start2 --> -<g id="edge13" class="edge"> -<title>If17->Start2:p2</title> -<path fill="none" stroke="black" d="M301,-498C306.61,-537.22 310.42,-547.63 306,-587 304.69,-598.67 301.49,-604.88 299.06,-612.05"/> -<polygon fill="black" stroke="black" points="295.7,-611.02 296.82,-621.55 302.52,-612.62 295.7,-611.02"/> -<text text-anchor="middle" x="298.75" y="-500.15" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_21 --> -<g id="node12" class="node"> -<title>Con_21</title> -<ellipse fill="none" stroke="black" cx="165" cy="-409.5" rx="27" ry="18"/> -<text text-anchor="middle" x="165" y="-404.45" font-family="Times New Roman,serif" font-size="14.00">#1</text> -</g> -<!-- Store22 --> -<g id="node13" class="node"> -<title>Store22</title> -<ellipse fill="none" stroke="black" cx="135" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="135" y="-316.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store22->new9 --> -<g id="edge15" class="edge"> -<title>Store22->new9</title> -<path fill="none" stroke="black" d="M113.11,-332.75C95.54,-341.64 71.49,-356.38 57,-376 48.02,-388.16 50.79,-393.87 47,-408.5"/> -<text text-anchor="middle" x="115.36" y="-334.9" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store22->Store14 --> -<g id="edge14" class="edge"> -<title>Store22->Store14</title> -<path fill="none" stroke="blue" d="M126.9,-339.49C120.98,-351.55 112.81,-368.17 105.98,-382.08"/> -<polygon fill="blue" stroke="blue" points="103.01,-380.19 101.74,-390.71 109.29,-383.27 103.01,-380.19"/> -<text text-anchor="middle" x="124.65" y="-341.64" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store22->Con_21 --> -<g id="edge16" class="edge"> -<title>Store22->Con_21</title> -<path fill="none" stroke="black" d="M140.93,-339.89C145.04,-351.6 150.6,-367.46 155.34,-380.98"/> -<polygon fill="black" stroke="black" points="151.97,-381.94 158.58,-390.21 158.58,-379.62 151.97,-381.94"/> -<text text-anchor="middle" x="138.68" y="-342.04" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Region23 --> -<g id="node14" class="node"> -<title>Region23</title> -<polygon fill="yellow" stroke="black" points="285.5,-268 230.5,-268 230.5,-232 285.5,-232 285.5,-268"/> -<text text-anchor="middle" x="258" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">Region</text> -</g> -<!-- Region23->If17 --> -<g id="edge17" class="edge"> -<title>Region23->If17:p0</title> -<path fill="none" stroke="red" d="M258.16,-268.22C258.36,-291.29 258.68,-333.85 258.74,-372.64"/> -<polygon fill="red" stroke="red" points="255.24,-372.49 258.75,-382.49 262.24,-372.48 255.24,-372.49"/> -<text text-anchor="middle" x="255.91" y="-270.37" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_224->Store14 --> -<g id="edge21" class="edge"> -<title>Phi_224->Store14</title> -<path fill="none" stroke="blue" d="M122.4,-267.57C113.78,-277.31 104.01,-290.37 99,-304 90,-328.5 89.21,-358.4 90.25,-379.93"/> -<polygon fill="blue" stroke="blue" points="86.75,-379.98 90.9,-389.73 93.73,-379.52 86.75,-379.98"/> -<text text-anchor="middle" x="120.15" y="-269.72" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_224->Store22 --> -<g id="edge20" class="edge"> -<title>Phi_224->Store22</title> -<path fill="none" stroke="blue" d="M138.01,-268.3C137.59,-275.59 137.1,-284.27 136.63,-292.46"/> -<polygon fill="blue" stroke="blue" points="133.14,-292.2 136.06,-302.38 140.13,-292.6 133.14,-292.2"/> -<text text-anchor="middle" x="135.76" y="-270.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_224->Region23 --> -<g id="edge19" class="edge"> -<title>Phi_224->Region23</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M191.99,-250C200.94,-250 209.88,-250 218.82,-250"/> -<polygon fill="black" stroke="black" points="218.64,-253.5 228.64,-250 218.64,-246.5 218.64,-253.5"/> -<text text-anchor="middle" x="194.24" y="-242.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return25->MemMerge --> -<g id="edge24" class="edge"> -<title>Return25->MemMerge</title> -<path fill="none" stroke="blue" d="M154,-124.3C154,-131.59 154,-140.27 154,-148.46"/> -<polygon fill="blue" stroke="blue" points="150.5,-148.38 154,-158.38 157.5,-148.38 150.5,-148.38"/> -<text text-anchor="middle" x="151.75" y="-126.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return25->Load16 --> -<g id="edge23" class="edge"> -<title>Return25->Load16</title> -<path fill="none" stroke="black" d="M134.47,-124.14C124.31,-133.85 112.32,-146.7 104,-160 77.05,-203.06 59,-259.91 49.91,-293.26"/> -<polygon fill="black" stroke="black" points="46.62,-291.99 47.45,-302.55 53.39,-293.78 46.62,-291.99"/> -<text text-anchor="middle" x="132.22" y="-126.29" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return25->Region23 --> -<g id="edge22" class="edge"> -<title>Return25->Region23</title> -<path fill="none" stroke="red" d="M172.12,-124.31C182.08,-134.28 194.34,-147.32 204,-160 218.92,-179.59 233.25,-203.54 243.4,-221.66"/> -<polygon fill="red" stroke="red" points="240.24,-223.18 248.13,-230.25 246.37,-219.8 240.24,-223.18"/> -<text text-anchor="middle" x="169.87" y="-126.46" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="689" height="1044" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 689 1044" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(35,483)"><rect class="region-box" rx="8" width="433" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge MEM" id="e1i1" d="M340,118 L340,128 L24,128 L24,748 L268,748 L268,786" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[1] → #6 · MEM</title></path><path class="edge MEM" id="e1i2" d="M349,721 L349,748 L298,748 L298,786" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[2] → #224 · MEM</title></path><path class="edge CTRL" id="e3i0" d="M227,943 C227,967 344.5,970 344.5,994" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #25 · CTRL</title></path><path class="edge CTRL" id="e9i0" d="M220,118 L220,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge MEM" id="e12i1" d="M340,118 L340,128 L149,128 L149,242 L278,242 L278,270" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#12[1] → #6 · MEM</title></path><path class="edge DATA" id="e12i2" d="M220,222 L220,232 L302,232 L302,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[2] → #9 · DATA</title></path><path class="edge DATA" id="e12i3" d="M372,222 L372,242 L326,242 L326,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[3] → #11 · DATA</title></path><path class="edge CTRL" id="e13i0" d="M220,118 L220,148 L442,148 L442,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#13[0] → #5 · CTRL</title></path><path class="edge MEM" id="e14i1" d="M290,326 L290,346 L443,346 L443,374" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#14[1] → #12 · MEM</title></path><path class="edge DATA" id="e14i2" d="M442,326 L442,336 L467,336 L467,374" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge DATA" id="e14i3" d="M594,326 L594,336 L491,336 L491,374" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[3] → #4 · DATA</title></path><path class="edge MEM" id="e16i1" d="M455,430 L455,450 L560,450 L560,546" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#16[1] → #14 · MEM</title></path><path class="edge DATA" id="e16i2" d="M220,222 L220,232 L664,232 L664,440 L590,440 L590,546" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #9 · DATA</title></path><path class="edge CTRL" id="e17i0" d="M220,118 L220,148 L127,148 L127,517" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[0] → #5 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M460,118 L460,138 L138,138 L138,440 L207,440 L207,517" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #7 · DATA</title></path><path class="edge MEM" id="e22i1" d="M455,430 L455,450 L373,450 L373,528" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#22[1] → #14 · MEM</title></path><path class="edge DATA" id="e22i2" d="M220,222 L220,232 L219,232 L219,460 L397,460 L397,528" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[2] → #9 · DATA</title></path><path class="edge DATA" id="e22i3" d="M303,430 L303,440 L421,440 L421,528" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[3] → #21 · DATA</title></path><path class="edge CTRL" id="e23i1" d="M107,617 L107,627 L197,627 L197,665" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[1] → #8 · CTRL</title></path><path class="edge CTRL" id="e23i2" d="M227,617 L227,665" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[2] → #10 · CTRL</title></path><path class="edge CTRL" id="e25i0" d="M197,721 L197,890" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #23 · CTRL</title></path><path class="edge MEM" id="e25i1" d="M268,842 L268,852 L227,852 L227,890" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#25[1] → #1 · MEM</title></path><path class="edge DATA" id="e25i2" d="M560,602 L560,862 L257,862 L257,890" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[2] → #16 · DATA</title></path><path class="edge MEM" id="e224i1" d="M385,584 L385,627 L329,627 L329,665" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#224[1] → #22 · MEM</title></path><path class="edge MEM" id="e224i2" d="M455,430 L455,637 L369,637 L369,665" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#224[2] → #14 · MEM</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(208,792)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 MemMerge +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #224 MEM</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(160,24)" style="opacity: 1;"><path class="box" d="M0,0H360V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="180" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="180"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(308.5,994)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #25 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(534,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(160,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(280,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEM</title></g><g class="node" id="n7" data-id="7" transform="translate(400,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #7/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n8" data-id="8" transform="translate(47,567)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(160,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n10" data-id="10" transform="translate(167,567)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 False +Projection 1 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(312,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #2 +Type not computed + +</title></g><g class="node" id="n12" data-id="12" transform="translate(230,276)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 .f = +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #9 DATA +[3] → #11 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n13" data-id="13" transform="translate(382,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n14" data-id="14" transform="translate(395,380)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 .f = +Type not computed + +[0] → — DATA +[1] → #12 MEM +[2] → #13 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n16" data-id="16" transform="translate(500,552)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 .f +Type not computed + +[0] → — DATA +[1] → #14 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(47,523)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#17 If +Type not computed + +[0] → #5 CTRL +[1] → #7 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n21" data-id="21" transform="translate(243,380)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 #1 +Type not computed + +</title></g><g class="node" id="n22" data-id="22" transform="translate(325,534)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 .f = +Type not computed + +[0] → — DATA +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n23" data-id="23" transform="translate(137,671)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 Region +Type not computed + +[0] → — DATA +[1] → #8 CTRL +[2] → #10 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n25" data-id="25" transform="translate(167,896)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 Return +Type not computed + +[0] → #23 CTRL +[1] → #1 MEM +[2] → #16 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n224" data-id="224" transform="translate(289,671)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #224</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#224 MemPhi_2 +Type not computed + +[0] → #23 ASSOC +[1] → #22 MEM +[2] → #14 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #23</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(35,483)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #17"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph2.json b/chapter11/docs/graph2.json new file mode 100644 index 00000000..7c50307d --- /dev/null +++ b/chapter11/docs/graph2.json @@ -0,0 +1,33 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph2.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 23, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 224, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 1}}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 23, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "CTRL", "label": null}, {"idx": 2, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 23, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 224, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 23, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + {"id": 17, "par": 0, "nodes": [1, 8, 10, 17, 23, 224]} + ] +} diff --git a/chapter11/docs/graph2.svg b/chapter11/docs/graph2.svg index b8d43cc9..a3afd14f 100644 --- a/chapter11/docs/graph2.svg +++ b/chapter11/docs/graph2.svg @@ -1,335 +1,151 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="358pt" height="714pt" - viewBox="0.00 0.00 358.12 714.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 710)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-710 354.12,-710 354.12,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="10.12,-8 10.12,-698 342.12,-698 342.12,-8 10.12,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="178.5,-659.5 178.5,-686 283.75,-686 283.75,-659.5 178.5,-659.5"/> -<polygon fill="none" stroke="black" points="178.5,-659.5 178.5,-686 283.75,-686 283.75,-659.5 178.5,-659.5"/> -<text text-anchor="start" x="218.37" y="-667.7" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="178.5,-627 178.5,-659.5 283.75,-659.5 283.75,-627 178.5,-627"/> -<polygon fill="yellow" stroke="none" points="183.5,-632 183.5,-654.5 214.25,-654.5 214.25,-632 183.5,-632"/> -<polygon fill="none" stroke="black" points="183.5,-632 183.5,-654.5 214.25,-654.5 214.25,-632 183.5,-632"/> -<text text-anchor="start" x="186.5" y="-638.2" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="214.25,-632 214.25,-654.5 255.5,-654.5 255.5,-632 214.25,-632"/> -<text text-anchor="start" x="217.25" y="-638.2" font-family="Times New Roman,serif" font-size="14.00">$mem</text> -<polygon fill="none" stroke="black" points="255.5,-632 255.5,-654.5 278.75,-654.5 278.75,-632 255.5,-632"/> -<text text-anchor="start" x="258.5" y="-638.2" font-family="Times New Roman,serif" font-size="14.00">arg</text> -</g> -<!-- MemMerge --> -<g id="node2" class="node"> -<title>MemMerge</title> -<polygon fill="none" stroke="black" points="235.12,-196 153.12,-196 153.12,-160 235.12,-160 235.12,-196"/> -<text text-anchor="middle" x="194.12" y="-172.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> -</g> -<!-- MemMerge->Start2 --> -<g id="edge29" class="edge"> -<title>MemMerge->Start2:p1</title> -<path fill="none" stroke="blue" d="M230.64,-196.45C271.82,-218.98 333.12,-262.35 333.12,-321 333.12,-321 333.12,-321 333.12,-498 333.12,-542.32 315.79,-552.37 288.12,-587 271.8,-607.42 244.66,-602.71 236.96,-619.82"/> -<polygon fill="blue" stroke="blue" points="233.55,-619.04 235.15,-629.51 240.43,-620.33 233.55,-619.04"/> -<text text-anchor="middle" x="228.39" y="-198.6" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region23 --> -<g id="node14" class="node"> -<title>Region23</title> -<polygon fill="yellow" stroke="black" points="270.62,-268 215.62,-268 215.62,-232 270.62,-232 270.62,-268"/> -<text text-anchor="middle" x="243.12" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">Region</text> -</g> -<!-- MemMerge->Region23 --> -<g id="edge31" class="edge"> -<title>MemMerge->Region23</title> -<path fill="none" stroke="green" d="M206.23,-196.3C211.81,-204.27 218.55,-213.9 224.74,-222.74"/> -<polygon fill="green" stroke="green" points="221.68,-224.47 230.28,-230.66 227.41,-220.46 221.68,-224.47"/> -<text text-anchor="middle" x="203.98" y="-198.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_224 --> -<g id="node15" class="node"> -<title>Phi_224</title> -<ellipse fill="lightyellow" stroke="black" cx="145.12" cy="-250" rx="52.89" ry="18"/> -<text text-anchor="middle" x="145.12" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- MemMerge->Phi_224 --> -<g id="edge30" class="edge"> -<title>MemMerge->Phi_224</title> -<path fill="none" stroke="blue" d="M182.01,-196.3C176.35,-204.39 169.49,-214.19 163.23,-223.13"/> -<polygon fill="blue" stroke="blue" points="160.49,-220.94 157.62,-231.14 166.23,-224.95 160.49,-220.94"/> -<text text-anchor="middle" x="179.76" y="-198.45" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="136.12,-52 82.12,-52 82.12,-16 136.12,-16 136.12,-52"/> -<text text-anchor="middle" x="109.12" y="-28.95" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return25 --> -<g id="node16" class="node"> -<title>Return25</title> -<polygon fill="yellow" stroke="black" points="136.12,-124 82.12,-124 82.12,-88 136.12,-88 136.12,-124"/> -<text text-anchor="middle" x="109.12" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return25 --> -<g id="edge1" class="edge"> -<title>Stop3->Return25</title> -<path fill="none" stroke="red" d="M109.12,-52.3C109.12,-59.59 109.12,-68.27 109.12,-76.46"/> -<polygon fill="red" stroke="red" points="105.62,-76.38 109.12,-86.38 112.62,-76.38 105.62,-76.38"/> -<text text-anchor="middle" x="106.87" y="-54.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="85.12" cy="-497" rx="27" ry="18"/> -<text text-anchor="middle" x="85.12" y="-491.95" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- new9 --> -<g id="node5" class="node"> -<title>new9</title> -<ellipse fill="none" stroke="black" cx="158.12" cy="-569" rx="33.95" ry="18"/> -<text text-anchor="middle" x="158.12" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new9->Start2 --> -<g id="edge2" class="edge"> -<title>new9->Start2:p0</title> -<path fill="none" stroke="green" d="M175.17,-584.76C183.98,-593.73 193.64,-606.07 197.33,-619.77"/> -<polygon fill="green" stroke="green" points="193.84,-620.07 198.66,-629.5 200.77,-619.12 193.84,-620.07"/> -<text text-anchor="middle" x="177.42" y="-586.91" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_11 --> -<g id="node6" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="black" cx="237.12" cy="-569" rx="27" ry="18"/> -<text text-anchor="middle" x="237.12" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">#2</text> -</g> -<!-- Store12 --> -<g id="node7" class="node"> -<title>Store12</title> -<ellipse fill="none" stroke="black" cx="200.12" cy="-497" rx="27" ry="18"/> -<text text-anchor="middle" x="200.12" y="-491.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store12->Start2 --> -<g id="edge3" class="edge"> -<title>Store12->Start2:p0</title> -<path fill="none" stroke="red" d="M283.12,-570C284.3,-608.41 225.3,-593.17 205.36,-613.49"/> -<polygon fill="red" stroke="red" points="202.48,-611.47 200.58,-621.89 208.57,-614.92 202.48,-611.47"/> -<path fill="none" stroke="red" d="M223.33,-506.27C247.55,-516.58 282.16,-536.72 283.12,-568"/> -<text text-anchor="middle" x="280.87" y="-562.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store12->new9 --> -<g id="edge5" class="edge"> -<title>Store12->new9</title> -<path fill="none" stroke="black" d="M190.38,-514.24C185.52,-522.33 179.52,-532.34 174.02,-541.51"/> -<polygon fill="black" stroke="black" points="171.02,-539.69 168.88,-550.07 177.03,-543.29 171.02,-539.69"/> -<text text-anchor="middle" x="188.13" y="-516.39" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store12->Con_11 --> -<g id="edge6" class="edge"> -<title>Store12->Con_11</title> -<path fill="none" stroke="black" d="M208.7,-514.24C213.05,-522.45 218.42,-532.63 223.33,-541.91"/> -<polygon fill="black" stroke="black" points="220.11,-543.31 227.88,-550.51 226.3,-540.04 220.11,-543.31"/> -<text text-anchor="middle" x="206.45" y="-516.39" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- new13 --> -<g id="node8" class="node"> -<title>new13</title> -<ellipse fill="none" stroke="black" cx="72.12" cy="-569" rx="33.95" ry="18"/> -<text text-anchor="middle" x="72.12" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new13->Start2 --> -<g id="edge7" class="edge"> -<title>new13->Start2:p0</title> -<path fill="none" stroke="green" d="M84.9,-585.89C102,-605.42 134.45,-636.66 171.03,-642.35"/> -<polygon fill="green" stroke="green" points="170.74,-645.84 180.99,-643.13 171.29,-638.86 170.74,-645.84"/> -<text text-anchor="middle" x="82.65" y="-588.04" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store14 --> -<g id="node9" class="node"> -<title>Store14</title> -<ellipse fill="none" stroke="black" cx="65.12" cy="-409.5" rx="27" ry="18"/> -<text text-anchor="middle" x="65.12" y="-404.45" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store14->Start2 --> -<g id="edge8" class="edge"> -<title>Store14->Start2:p0</title> -<path fill="none" stroke="red" d="M39.12,-498C35.91,-530.2 3.02,-539.93 19.12,-568"/> -<path fill="none" stroke="red" d="M57.93,-427.13C51.12,-444.08 41.58,-471.3 39.12,-496"/> -<text text-anchor="middle" x="36.87" y="-490.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store14->Con_4 --> -<g id="edge11" class="edge"> -<title>Store14->Con_4</title> -<path fill="none" stroke="black" d="M69.07,-427.39C71.77,-438.91 75.4,-454.44 78.53,-467.81"/> -<polygon fill="black" stroke="black" points="75.08,-468.44 80.76,-477.38 81.89,-466.84 75.08,-468.44"/> -<text text-anchor="middle" x="66.82" y="-429.54" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store14->Store12 --> -<g id="edge9" class="edge"> -<title>Store14->Store12</title> -<path fill="none" stroke="blue" d="M84.18,-422.57C106.99,-437.02 145.41,-461.35 171.73,-478.02"/> -<polygon fill="blue" stroke="blue" points="169.56,-480.79 179.88,-483.18 173.31,-474.88 169.56,-480.79"/> -<text text-anchor="middle" x="86.43" y="-424.72" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store14->new13 --> -<g id="edge10" class="edge"> -<title>Store14->new13</title> -<path fill="none" stroke="black" d="M39.12,-498C37.54,-513.82 44.48,-529.98 52.39,-542.78"/> -<polygon fill="black" stroke="black" points="49.45,-544.68 57.96,-551 55.25,-540.75 49.45,-544.68"/> -<text text-anchor="middle" x="36.87" y="-500.15" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Load16 --> -<g id="node10" class="node"> -<title>Load16</title> -<ellipse fill="none" stroke="black" cx="45.12" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="45.12" y="-316.95" font-family="Times New Roman,serif" font-size="14.00">.f</text> -</g> -<!-- Load16->Start2 --> -<g id="edge12" class="edge"> -<title>Load16->Start2:p0</title> -<path fill="none" stroke="red" d="M37.1,-339.54C18.2,-381.13 -24.39,-492.12 19.12,-568"/> -<path fill="none" stroke="red" d="M19.12,-570C23.95,-577.31 22.39,-581.38 29.12,-587 78.43,-628.14 103.69,-640.51 159.1,-642.82"/> -<polygon fill="red" stroke="red" points="158.99,-646.32 169.09,-643.11 159.19,-639.32 158.99,-646.32"/> -<text text-anchor="middle" x="34.85" y="-341.69" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Load16->new9 --> -<g id="edge14" class="edge"> -<title>Load16->new9</title> -<path fill="none" stroke="black" d="M63.11,-335.98C75.41,-345.72 91.23,-360.08 101.12,-376 109.09,-388.84 106.98,-393.97 111.12,-408.5"/> -<path fill="none" stroke="black" d="M111.12,-410.5C124.08,-456.01 139.97,-508.64 149.56,-540.08"/> -<polygon fill="black" stroke="black" points="146.19,-541.04 152.46,-549.58 152.89,-538.99 146.19,-541.04"/> -<text text-anchor="middle" x="60.86" y="-338.13" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Load16->Store14 --> -<g id="edge13" class="edge"> -<title>Load16->Store14</title> -<path fill="none" stroke="blue" d="M49.07,-339.89C51.77,-351.41 55.4,-366.94 58.53,-380.31"/> -<polygon fill="blue" stroke="blue" points="55.08,-380.94 60.76,-389.88 61.89,-379.34 55.08,-380.94"/> -<text text-anchor="middle" x="46.82" y="-342.04" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If17 --> -<g id="node11" class="node"> -<title>If17</title> -<polygon fill="yellow" stroke="none" points="230.12,-412.5 230.12,-439 306.12,-439 306.12,-412.5 230.12,-412.5"/> -<polygon fill="none" stroke="black" points="230.12,-412.5 230.12,-439 306.12,-439 306.12,-412.5 230.12,-412.5"/> -<text text-anchor="start" x="263.62" y="-420.7" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="230.12,-380 230.12,-412.5 306.12,-412.5 306.12,-380 230.12,-380"/> -<polygon fill="yellow" stroke="none" points="235.12,-385 235.12,-407.5 266.62,-407.5 266.62,-385 235.12,-385"/> -<polygon fill="none" stroke="black" points="235.12,-385 235.12,-407.5 266.62,-407.5 266.62,-385 235.12,-385"/> -<text text-anchor="start" x="238.12" y="-391.2" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="266.62,-385 266.62,-407.5 301.12,-407.5 301.12,-385 266.62,-385"/> -<polygon fill="none" stroke="black" points="266.62,-385 266.62,-407.5 301.12,-407.5 301.12,-385 266.62,-385"/> -<text text-anchor="start" x="269.62" y="-391.2" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If17->Start2 --> -<g id="edge15" class="edge"> -<title>If17->Start2:p0</title> -<path fill="none" stroke="red" d="M263.95,-442.76C262.88,-459.03 263.19,-478.88 268.12,-496"/> -<text text-anchor="middle" x="261.7" y="-444.91" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_21 --> -<g id="node12" class="node"> -<title>Con_21</title> -<ellipse fill="none" stroke="black" cx="157.12" cy="-409.5" rx="27" ry="18"/> -<text text-anchor="middle" x="157.12" y="-404.45" font-family="Times New Roman,serif" font-size="14.00">#1</text> -</g> -<!-- Store22 --> -<g id="node13" class="node"> -<title>Store22</title> -<ellipse fill="none" stroke="black" cx="117.12" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="117.12" y="-316.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store22->Start2 --> -<g id="edge17" class="edge"> -<title>Store22->Start2:p0</title> -<path fill="none" stroke="red" d="M138.84,-333.04C155.95,-342.01 179.17,-356.71 193.12,-376 211.33,-401.18 196.96,-416.46 213.12,-443 230.78,-471.99 258.72,-463.38 268.12,-496"/> -<path fill="none" stroke="red" d="M268.12,-498C276.93,-528.57 282.14,-536.2 283.12,-568"/> -<text text-anchor="middle" x="136.59" y="-335.19" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store22->new9 --> -<g id="edge19" class="edge"> -<title>Store22->new9</title> -<path fill="none" stroke="black" d="M112.54,-340.07C108.62,-357.58 104.56,-385.46 111.12,-408.5"/> -<text text-anchor="middle" x="110.29" y="-342.22" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store22->Store14 --> -<g id="edge18" class="edge"> -<title>Store22->Store14</title> -<path fill="none" stroke="blue" d="M107.34,-339.08C99.86,-351.38 89.4,-368.59 80.76,-382.79"/> -<polygon fill="blue" stroke="blue" points="77.85,-380.83 75.64,-391.2 83.83,-384.47 77.85,-380.83"/> -<text text-anchor="middle" x="105.09" y="-341.23" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store22->Con_21 --> -<g id="edge20" class="edge"> -<title>Store22->Con_21</title> -<path fill="none" stroke="black" d="M124.83,-339.49C130.39,-351.36 138,-367.64 144.44,-381.4"/> -<polygon fill="black" stroke="black" points="141.25,-382.83 148.65,-390.4 147.59,-379.86 141.25,-382.83"/> -<text text-anchor="middle" x="122.58" y="-341.64" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Region23->If17 --> -<g id="edge21" class="edge"> -<title>Region23->If17:p0</title> -<path fill="none" stroke="red" d="M244.76,-268.2C246.83,-291.25 250.19,-333.78 250.78,-372.63"/> -<polygon fill="red" stroke="red" points="247.28,-372.51 250.86,-382.49 254.28,-372.46 247.28,-372.51"/> -<text text-anchor="middle" x="242.51" y="-270.35" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region23->If17 --> -<g id="edge22" class="edge"> -<title>Region23->If17:p1</title> -<path fill="none" stroke="red" d="M252.57,-268.22C257.8,-278.38 264.05,-291.63 268.12,-304 278.15,-334.53 282.78,-345.32 283.7,-372.64"/> -<polygon fill="red" stroke="red" points="280.19,-372.54 283.85,-382.49 287.19,-372.43 280.19,-372.54"/> -<text text-anchor="middle" x="250.32" y="-270.37" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_224->Store14 --> -<g id="edge25" class="edge"> -<title>Phi_224->Store14</title> -<path fill="none" stroke="blue" d="M151.73,-268.04C157.85,-286.71 164.45,-317.05 153.12,-340 141.47,-363.59 126.88,-359.83 106.12,-376 101.11,-379.91 95.77,-384.11 90.66,-388.15"/> -<polygon fill="blue" stroke="blue" points="88.67,-385.26 83.01,-394.21 93.02,-390.74 88.67,-385.26"/> -<text text-anchor="middle" x="149.48" y="-270.19" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_224->Store22 --> -<g id="edge24" class="edge"> -<title>Phi_224->Store22</title> -<path fill="none" stroke="blue" d="M138.2,-268.3C135.14,-275.96 131.46,-285.15 128.04,-293.7"/> -<polygon fill="blue" stroke="blue" points="124.8,-292.39 124.33,-302.97 131.3,-294.99 124.8,-292.39"/> -<text text-anchor="middle" x="135.95" y="-270.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_224->Region23 --> -<g id="edge23" class="edge"> -<title>Phi_224->Region23</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M198.33,-250C200.17,-250 202.01,-250 203.84,-250"/> -<polygon fill="black" stroke="black" points="203.61,-253.5 213.61,-250 203.61,-246.5 203.61,-253.5"/> -<text text-anchor="middle" x="200.58" y="-242.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return25->MemMerge --> -<g id="edge28" class="edge"> -<title>Return25->MemMerge</title> -<path fill="none" stroke="blue" d="M130.13,-124.3C140.45,-132.8 153.06,-143.19 164.35,-152.49"/> -<polygon fill="blue" stroke="blue" points="161.94,-155.04 171.89,-158.69 166.39,-149.63 161.94,-155.04"/> -<text text-anchor="middle" x="127.88" y="-126.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return25->Load16 --> -<g id="edge27" class="edge"> -<title>Return25->Load16</title> -<path fill="none" stroke="black" d="M73.12,-179C81.32,-218.99 67.84,-265.4 56.89,-293.98"/> -<polygon fill="black" stroke="black" points="53.76,-292.38 53.29,-302.96 60.26,-294.99 53.76,-292.38"/> -<path fill="none" stroke="black" d="M92.26,-124.39C81.14,-137.97 69.27,-157.7 73.12,-177"/> -<text text-anchor="middle" x="70.87" y="-171.4" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return25->Region23 --> -<g id="edge26" class="edge"> -<title>Return25->Region23</title> -<path fill="none" stroke="red" d="M73.12,-179C85.3,-238.43 141.92,-209.98 204.75,-231.55"/> -<polygon fill="red" stroke="red" points="203.29,-234.74 213.88,-235.09 205.83,-228.21 203.29,-234.74"/> -<text text-anchor="middle" x="70.87" y="-181.15" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="730" height="1150" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 730 1150" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,589)"><rect class="region-box" rx="8" width="371" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e1i0" d="M160,827 L160,837 L201,837 L201,875" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#1[0] → #23 · CTRL</title></path><path class="edge MEM" id="e1i1" d="M280,118 L280,138 L605,138 L605,338 L575,338 L575,442 L382,442 L382,837 L231,837 L231,875" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[1] → #6 · MEM</title></path><path class="edge MEM" id="e1i2" d="M312,827 L312,847 L261,847 L261,875" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[2] → #224 · MEM</title></path><path class="edge CTRL" id="e3i0" d="M190,1049 C190,1073 365,1076 365,1100" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #25 · CTRL</title></path><path class="edge CTRL" id="e9i0" d="M160,118 L160,148 L242,148 L242,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e12i0" d="M160,118 L160,262 L195,262 L195,272" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #5 · CTRL</title></path><path class="edge MEM" id="e12i1" d="M280,118 L280,138 L171,138 L171,232 L219,232 L219,272" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#12[1] → #6 · MEM</title></path><path class="edge DATA" id="e12i2" d="M242,222 L242,252 L243,252 L243,272" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[2] → #9 · DATA</title></path><path class="edge DATA" id="e12i3" d="M394,222 L394,232 L267,232 L267,272" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[3] → #11 · DATA</title></path><path class="edge CTRL" id="e13i0" d="M160,118 L160,148 L464,148 L464,242 L383,242 L383,272" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#13[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e14i0" d="M160,118 L160,348 L336,348 L336,376" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #5 · CTRL</title></path><path class="edge MEM" id="e14i1" d="M231,328 L231,338 L360,338 L360,376" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#14[1] → #12 · MEM</title></path><path class="edge DATA" id="e14i2" d="M383,328 L383,338 L384,338 L384,376" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge DATA" id="e14i3" d="M535,328 L535,338 L408,338 L408,376" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[3] → #4 · DATA</title></path><path class="edge CTRL" id="e16i0" d="M160,118 L160,148 L616,148 L616,480" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #5 · CTRL</title></path><path class="edge MEM" id="e16i1" d="M372,432 L372,452 L646,452 L646,480" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#16[1] → #14 · MEM</title></path><path class="edge DATA" id="e16i2" d="M242,222 L242,252 L627,252 L627,442 L676,442 L676,480" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #9 · DATA</title></path><path class="edge CTRL" id="e17i0" d="M160,118 L160,148 L116,148 L116,623" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[0] → #5 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M400,118 L400,128 L127,128 L127,556 L196,556 L196,623" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #7 · DATA</title></path><path class="edge CTRL" id="e22i0" d="M160,118 L160,262 L138,262 L138,452 L162,452 L162,480" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#22[0] → #5 · CTRL</title></path><path class="edge MEM" id="e22i1" d="M372,432 L372,452 L186,452 L186,480" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#22[1] → #14 · MEM</title></path><path class="edge DATA" id="e22i2" d="M242,222 L242,252 L149,252 L149,442 L210,442 L210,480" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[2] → #9 · DATA</title></path><path class="edge DATA" id="e22i3" d="M220,432 L220,462 L234,462 L234,480" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[3] → #21 · DATA</title></path><path class="edge CTRL" id="e23i1" d="M96,723 L96,733 L160,733 L160,771" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[1] → #8 · CTRL</title></path><path class="edge CTRL" id="e23i2" d="M216,723 L216,733 L190,733 L190,771" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[2] → #10 · CTRL</title></path><path class="edge CTRL" id="e25i0" d="M160,827 L160,996" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #23 · CTRL</title></path><path class="edge MEM" id="e25i1" d="M231,931 L231,958 L190,958 L190,996" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#25[1] → #1 · MEM</title></path><path class="edge DATA" id="e25i2" d="M646,536 L646,968 L220,968 L220,996" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[2] → #16 · DATA</title></path><path class="edge MEM" id="e224i1" d="M198,536 L198,546 L292,546 L292,771" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#224[1] → #22 · MEM</title></path><path class="edge MEM" id="e224i2" d="M372,432 L372,452 L332,452 L332,771" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#224[2] → #14 · MEM</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(171,881)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 MemMerge +Type not computed + +[0] → #23 CTRL +[1] → #6 MEM +[2] → #224 MEM</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(100,24)" style="opacity: 1;"><path class="box" d="M0,0H360V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="180" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="180"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(329,1100)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #25 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(475,278)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(100,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(220,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEM</title></g><g class="node" id="n7" data-id="7" transform="translate(340,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #7/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n8" data-id="8" transform="translate(36,673)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(182,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n10" data-id="10" transform="translate(156,673)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 False +Projection 1 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(334,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #2 +Type not computed + +</title></g><g class="node" id="n12" data-id="12" transform="translate(171,278)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 .f = +Type not computed + +[0] → #5 CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #11 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n13" data-id="13" transform="translate(323,278)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n14" data-id="14" transform="translate(312,382)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 .f = +Type not computed + +[0] → #5 CTRL +[1] → #12 MEM +[2] → #13 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n16" data-id="16" transform="translate(586,486)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 .f +Type not computed + +[0] → #5 CTRL +[1] → #14 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(36,629)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#17 If +Type not computed + +[0] → #5 CTRL +[1] → #7 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n21" data-id="21" transform="translate(160,382)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 #1 +Type not computed + +</title></g><g class="node" id="n22" data-id="22" transform="translate(138,486)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 .f = +Type not computed + +[0] → #5 CTRL +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n23" data-id="23" transform="translate(100,777)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 Region +Type not computed + +[0] → — DATA +[1] → #8 CTRL +[2] → #10 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n25" data-id="25" transform="translate(130,1002)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 Return +Type not computed + +[0] → #23 CTRL +[1] → #1 MEM +[2] → #16 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n224" data-id="224" transform="translate(252,777)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #224</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#224 MemPhi_2 +Type not computed + +[0] → #23 ASSOC +[1] → #22 MEM +[2] → #14 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #23</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,589)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><title>If · 6 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #17"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph3-snip.json b/chapter11/docs/graph3-snip.json new file mode 100644 index 00000000..00b3e744 --- /dev/null +++ b/chapter11/docs/graph3-snip.json @@ -0,0 +1,20 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph3-snip.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 0, "role": "MEM", "label": null}, {"idx": 2, "def": 0, "role": "DATA", "label": null}, {"idx": 3, "def": 0, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 0, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}, {"idx": 4, "def": 16, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter11/docs/graph3-snip.svg b/chapter11/docs/graph3-snip.svg new file mode 100644 index 00000000..cf6420c5 --- /dev/null +++ b/chapter11/docs/graph3-snip.svg @@ -0,0 +1,102 @@ +<svg aria-label="Compiler graph" width="478" height="500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 478 500" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e9i0" d="M124,118 L124,128 L301,128 L301,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e14i0" d="M124,118 L124,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e16i0" d="M124,118 L124,128 L230,128 L230,242 L364,242 L364,281" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #5 · CTRL</title></path><path class="edge MEM" id="e16i1" d="M160,222 L160,252 L394,252 L394,281" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#16[1] → #14 · MEM</title></path><path class="edge DATA" id="e16i2" d="M301,222 L301,232 L424,232 L424,281" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #9 · DATA</title></path><path class="edge CTRL" id="e17i0" d="M124,118 L124,128 L64,128 L64,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e22i0" d="M84,370 L84,420" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#22[0] → #8 · CTRL</title></path><path class="edge MEM" id="e22i1" d="M160,222 L160,380 L104,380 L104,420" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#22[1] → #14 · MEM</title></path><path class="edge DATA" id="e22i2" d="M301,222 L301,232 L171,232 L171,390 L124,390 L124,420" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[2] → #9 · DATA</title></path><path class="edge DATA" id="e22i3" d="M242,370 L242,400 L144,400 L144,420" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[3] → #21 · DATA</title></path><path class="edge DATA" id="e22i4" d="M394,337 L394,410 L164,410 L164,420" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[4] → #16 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n2" data-id="2" transform="translate(64,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(64,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(24,320)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(241,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n14" data-id="14" transform="translate(100,172)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 .f = +Type not computed + +[0] → #5 CTRL +[1] → — MEM +[2] → — DATA +[3] → — DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="white"/><circle class="port" cx="72" cy="-3" r="3" fill="white"/><circle class="port" cx="96" cy="-3" r="3" fill="white"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n16" data-id="16" transform="translate(334,287)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 .f +Type not computed + +[0] → #5 CTRL +[1] → #14 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(24,276)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 If +Type not computed + +[0] → #5 CTRL +[1] → — DATA</title><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="white"/><text class="slot" x="40" y="-10" text-anchor="middle">0</text><text class="slot" x="80" y="-10" text-anchor="middle">1</text></g><g class="node" id="n21" data-id="21" transform="translate(182,320)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 #1 +Type not computed + +</title></g><g class="node" id="n22" data-id="22" transform="translate(64,426)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 .f = +Type not computed + +[0] → #8 CTRL +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA +[4] → #16 DATA</title><circle class="port" cx="20" cy="-3" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="100" cy="-3" r="3" fill="#536477"/><text class="slot" x="20" y="-10" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="60" y="-10" text-anchor="middle">2</text><text class="slot" x="80" y="-10" text-anchor="middle">3</text><text class="slot" x="100" y="-10" text-anchor="middle">4</text></g></g><g class="region-heads" style="opacity: 1;"/><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph3.json b/chapter11/docs/graph3.json new file mode 100644 index 00000000..998c6f87 --- /dev/null +++ b/chapter11/docs/graph3.json @@ -0,0 +1,33 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph3.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 23, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 224, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 17, "role": "CTRL", "label": null}], "proj": {"par": 17, "idx": 1}}, + {"id": 11, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 12, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 11, "role": "DATA", "label": null}], "proj": null}, + {"id": 13, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 16, "label": ".f", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 22, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}, {"idx": 4, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 23, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "CTRL", "label": null}, {"idx": 2, "def": 10, "role": "CTRL", "label": null}], "proj": null}, + {"id": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 23, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, + {"id": 224, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 23, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + {"id": 17, "par": 0, "nodes": [1, 8, 10, 17, 22, 23, 224]} + ] +} diff --git a/chapter11/docs/graph3.svg b/chapter11/docs/graph3.svg index a16a1733..6fe5fe73 100644 --- a/chapter11/docs/graph3.svg +++ b/chapter11/docs/graph3.svg @@ -1,348 +1,152 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="356pt" height="786pt" - viewBox="0.00 0.00 356.00 786.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 782)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-782 352,-782 352,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-770 340,-770 340,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="218.38,-731.5 218.38,-758 323.62,-758 323.62,-731.5 218.38,-731.5"/> -<polygon fill="none" stroke="black" points="218.38,-731.5 218.38,-758 323.62,-758 323.62,-731.5 218.38,-731.5"/> -<text text-anchor="start" x="258.25" y="-739.7" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="218.38,-699 218.38,-731.5 323.62,-731.5 323.62,-699 218.38,-699"/> -<polygon fill="yellow" stroke="none" points="223.38,-704 223.38,-726.5 254.12,-726.5 254.12,-704 223.38,-704"/> -<polygon fill="none" stroke="black" points="223.38,-704 223.38,-726.5 254.12,-726.5 254.12,-704 223.38,-704"/> -<text text-anchor="start" x="226.38" y="-710.2" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="254.12,-704 254.12,-726.5 295.38,-726.5 295.38,-704 254.12,-704"/> -<text text-anchor="start" x="257.12" y="-710.2" font-family="Times New Roman,serif" font-size="14.00">$mem</text> -<polygon fill="none" stroke="black" points="295.38,-704 295.38,-726.5 318.62,-726.5 318.62,-704 295.38,-704"/> -<text text-anchor="start" x="298.38" y="-710.2" font-family="Times New Roman,serif" font-size="14.00">arg</text> -</g> -<!-- MemMerge --> -<g id="node2" class="node"> -<title>MemMerge</title> -<polygon fill="none" stroke="black" points="234,-196 152,-196 152,-160 234,-160 234,-196"/> -<text text-anchor="middle" x="193" y="-172.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> -</g> -<!-- MemMerge->Start2 --> -<g id="edge30" class="edge"> -<title>MemMerge->Start2:p1</title> -<path fill="none" stroke="blue" d="M234.18,-194.39C253.1,-203.11 274.68,-215.59 290,-232 319.72,-263.83 331,-277.45 331,-321 331,-321 331,-321 331,-498 331,-538.11 326.09,-548.18 316,-587 309.95,-610.27 282.67,-661.11 276.15,-691.66"/> -<polygon fill="blue" stroke="blue" points="272.69,-691.14 274.94,-701.5 279.64,-692 272.69,-691.14"/> -<text text-anchor="middle" x="236.43" y="-186.79" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region23 --> -<g id="node14" class="node"> -<title>Region23</title> -<polygon fill="yellow" stroke="black" points="280.5,-268 225.5,-268 225.5,-232 280.5,-232 280.5,-268"/> -<text text-anchor="middle" x="253" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">Region</text> -</g> -<!-- MemMerge->Region23 --> -<g id="edge32" class="edge"> -<title>MemMerge->Region23</title> -<path fill="none" stroke="green" d="M207.83,-196.3C214.81,-204.44 223.27,-214.31 230.97,-223.3"/> -<polygon fill="green" stroke="green" points="228.19,-225.43 237.35,-230.75 233.5,-220.88 228.19,-225.43"/> -<text text-anchor="middle" x="205.58" y="-198.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_224 --> -<g id="node15" class="node"> -<title>Phi_224</title> -<ellipse fill="lightyellow" stroke="black" cx="155" cy="-250" rx="52.89" ry="18"/> -<text text-anchor="middle" x="155" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- MemMerge->Phi_224 --> -<g id="edge31" class="edge"> -<title>MemMerge->Phi_224</title> -<path fill="none" stroke="blue" d="M183.61,-196.3C179.42,-204.02 174.39,-213.29 169.72,-221.89"/> -<polygon fill="blue" stroke="blue" points="166.7,-220.11 165.01,-230.57 172.85,-223.45 166.7,-220.11"/> -<text text-anchor="middle" x="181.36" y="-198.45" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="220,-52 166,-52 166,-16 220,-16 220,-52"/> -<text text-anchor="middle" x="193" y="-28.95" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return25 --> -<g id="node16" class="node"> -<title>Return25</title> -<polygon fill="yellow" stroke="black" points="220,-124 166,-124 166,-88 220,-88 220,-124"/> -<text text-anchor="middle" x="193" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return25 --> -<g id="edge1" class="edge"> -<title>Stop3->Return25</title> -<path fill="none" stroke="red" d="M193,-52.3C193,-59.59 193,-68.27 193,-76.46"/> -<polygon fill="red" stroke="red" points="189.5,-76.38 193,-86.38 196.5,-76.38 189.5,-76.38"/> -<text text-anchor="middle" x="190.75" y="-54.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="235" cy="-569" rx="27" ry="18"/> -<text text-anchor="middle" x="235" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- new9 --> -<g id="node5" class="node"> -<title>new9</title> -<ellipse fill="none" stroke="black" cx="70" cy="-641" rx="33.95" ry="18"/> -<text text-anchor="middle" x="70" y="-635.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new9->Start2 --> -<g id="edge2" class="edge"> -<title>new9->Start2:p0</title> -<path fill="none" stroke="green" d="M87.44,-656.82C112.58,-676.72 161.43,-710.12 211.1,-714.72"/> -<polygon fill="green" stroke="green" points="210.71,-718.2 220.86,-715.18 211.04,-711.21 210.71,-718.2"/> -<text text-anchor="middle" x="89.69" y="-658.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_11 --> -<g id="node6" class="node"> -<title>Con_11</title> -<ellipse fill="none" stroke="black" cx="235" cy="-641" rx="27" ry="18"/> -<text text-anchor="middle" x="235" y="-635.95" font-family="Times New Roman,serif" font-size="14.00">#2</text> -</g> -<!-- Store12 --> -<g id="node7" class="node"> -<title>Store12</title> -<ellipse fill="none" stroke="black" cx="163" cy="-569" rx="27" ry="18"/> -<text text-anchor="middle" x="163" y="-563.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store12->Start2 --> -<g id="edge3" class="edge"> -<title>Store12->Start2:p0</title> -<path fill="none" stroke="red" d="M184.74,-580.27C215.27,-594.76 267.54,-619.8 271,-623 277.43,-628.96 279.81,-631.32 281,-640"/> -<path fill="none" stroke="red" d="M281,-642C284.46,-667.2 257.45,-670.2 244.91,-685.38"/> -<polygon fill="red" stroke="red" points="241.97,-683.46 240.43,-693.94 248.17,-686.71 241.97,-683.46"/> -<text text-anchor="middle" x="182.49" y="-582.42" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store12->new9 --> -<g id="edge5" class="edge"> -<title>Store12->new9</title> -<path fill="none" stroke="black" d="M145.51,-583.17C132.17,-593.2 113.54,-607.23 98.12,-618.83"/> -<polygon fill="black" stroke="black" points="96.11,-615.97 90.22,-624.78 100.32,-621.56 96.11,-615.97"/> -<text text-anchor="middle" x="143.26" y="-585.32" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store12->Con_11 --> -<g id="edge6" class="edge"> -<title>Store12->Con_11</title> -<path fill="none" stroke="black" d="M177.92,-584.5C187.77,-594.08 200.86,-606.81 212.03,-617.66"/> -<polygon fill="black" stroke="black" points="209.41,-620 219.02,-624.46 214.29,-614.98 209.41,-620"/> -<text text-anchor="middle" x="175.67" y="-586.65" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- new13 --> -<g id="node8" class="node"> -<title>new13</title> -<ellipse fill="none" stroke="black" cx="156" cy="-641" rx="33.95" ry="18"/> -<text text-anchor="middle" x="156" y="-635.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new13->Start2 --> -<g id="edge7" class="edge"> -<title>new13->Start2:p0</title> -<path fill="none" stroke="green" d="M162.55,-658.99C170.89,-677.84 187.18,-706.54 211.2,-713.63"/> -<polygon fill="green" stroke="green" points="210.48,-717.06 220.88,-715.03 211.48,-710.13 210.48,-717.06"/> -<text text-anchor="middle" x="160.3" y="-661.14" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store14 --> -<g id="node9" class="node"> -<title>Store14</title> -<ellipse fill="none" stroke="black" cx="182" cy="-497" rx="27" ry="18"/> -<text text-anchor="middle" x="182" y="-491.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store14->Start2 --> -<g id="edge8" class="edge"> -<title>Store14->Start2:p0</title> -<path fill="none" stroke="red" d="M205.98,-505.45C226.83,-513.27 255.99,-527.73 271,-551 292.57,-584.45 275.58,-600.57 281,-640"/> -<text text-anchor="middle" x="203.73" y="-507.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store14->Con_4 --> -<g id="edge11" class="edge"> -<title>Store14->Con_4</title> -<path fill="none" stroke="black" d="M193.76,-513.54C200.42,-522.33 208.89,-533.52 216.43,-543.47"/> -<polygon fill="black" stroke="black" points="213.53,-545.44 222.36,-551.3 219.11,-541.22 213.53,-545.44"/> -<text text-anchor="middle" x="191.51" y="-515.69" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store14->Store12 --> -<g id="edge9" class="edge"> -<title>Store14->Store12</title> -<path fill="none" stroke="blue" d="M177.4,-514.95C175.35,-522.51 172.87,-531.63 170.56,-540.15"/> -<polygon fill="blue" stroke="blue" points="167.2,-539.18 167.95,-549.75 173.95,-541.02 167.2,-539.18"/> -<text text-anchor="middle" x="175.15" y="-517.1" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store14->new13 --> -<g id="edge10" class="edge"> -<title>Store14->new13</title> -<path fill="none" stroke="black" d="M162.83,-510.26C150.03,-519.67 134.26,-533.91 127,-551 118.14,-571.85 127.53,-596.39 137.92,-614.41"/> -<polygon fill="black" stroke="black" points="134.8,-616.02 143.05,-622.65 140.74,-612.32 134.8,-616.02"/> -<text text-anchor="middle" x="160.58" y="-512.41" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Load16 --> -<g id="node10" class="node"> -<title>Load16</title> -<ellipse fill="none" stroke="black" cx="43" cy="-409.5" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-404.45" font-family="Times New Roman,serif" font-size="14.00">.f</text> -</g> -<!-- Load16->Start2 --> -<g id="edge12" class="edge"> -<title>Load16->Start2:p0</title> -<path fill="none" stroke="red" d="M49.4,-427.07C59.67,-455.78 77.82,-516.65 69,-568"/> -<path fill="none" stroke="red" d="M69,-570C64.24,-599.68 36.88,-594.62 27,-623 21.74,-638.11 17.38,-646.22 27,-659 50.34,-690 144.38,-709.24 199.08,-714.06"/> -<polygon fill="red" stroke="red" points="198.71,-717.54 208.93,-714.77 199.21,-710.56 198.71,-717.54"/> -<text text-anchor="middle" x="47.15" y="-429.22" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Load16->new9 --> -<g id="edge14" class="edge"> -<title>Load16->new9</title> -<path fill="none" stroke="black" d="M69,-570C66.69,-583.43 66.6,-598.53 67.22,-611.26"/> -<polygon fill="black" stroke="black" points="63.72,-611.35 67.89,-621.09 70.7,-610.88 63.72,-611.35"/> -<text text-anchor="middle" x="66.75" y="-562.4" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Load16->Store14 --> -<g id="edge13" class="edge"> -<title>Load16->Store14</title> -<path fill="none" stroke="blue" d="M62.33,-422.39C85.88,-436.87 125.88,-461.48 153.09,-478.22"/> -<polygon fill="blue" stroke="blue" points="151.2,-481.16 161.55,-483.42 154.86,-475.2 151.2,-481.16"/> -<text text-anchor="middle" x="64.58" y="-424.54" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If17 --> -<g id="node11" class="node"> -<title>If17</title> -<polygon fill="yellow" stroke="none" points="228,-412.5 228,-439 304,-439 304,-412.5 228,-412.5"/> -<polygon fill="none" stroke="black" points="228,-412.5 228,-439 304,-439 304,-412.5 228,-412.5"/> -<text text-anchor="start" x="261.5" y="-420.7" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="228,-380 228,-412.5 304,-412.5 304,-380 228,-380"/> -<polygon fill="yellow" stroke="none" points="233,-385 233,-407.5 264.5,-407.5 264.5,-385 233,-385"/> -<polygon fill="none" stroke="black" points="233,-385 233,-407.5 264.5,-407.5 264.5,-385 233,-385"/> -<text text-anchor="start" x="236" y="-391.2" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="264.5,-385 264.5,-407.5 299,-407.5 299,-385 264.5,-385"/> -<polygon fill="none" stroke="black" points="264.5,-385 264.5,-407.5 299,-407.5 299,-385 264.5,-385"/> -<text text-anchor="start" x="267.5" y="-391.2" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If17->Start2 --> -<g id="edge15" class="edge"> -<title>If17->Start2:p0</title> -<path fill="none" stroke="red" d="M311,-570C308.67,-603.77 276.11,-606.51 281,-640"/> -<path fill="none" stroke="red" d="M282.37,-442.96C296.46,-474.31 314.08,-523.46 311,-568"/> -<text text-anchor="middle" x="308.75" y="-562.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If17->Start2 --> -<g id="edge16" class="edge"> -<title>If17->Start2:p2</title> -<path fill="none" stroke="black" d="M311,-570C310.66,-622.18 307.81,-639.78 307.14,-683.82"/> -<polygon fill="black" stroke="black" points="303.64,-683.74 307.04,-693.78 310.64,-683.81 303.64,-683.74"/> -<text text-anchor="middle" x="308.75" y="-572.15" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_21 --> -<g id="node12" class="node"> -<title>Con_21</title> -<ellipse fill="none" stroke="black" cx="155" cy="-409.5" rx="27" ry="18"/> -<text text-anchor="middle" x="155" y="-404.45" font-family="Times New Roman,serif" font-size="14.00">#1</text> -</g> -<!-- Store22 --> -<g id="node13" class="node"> -<title>Store22</title> -<ellipse fill="none" stroke="black" cx="155" cy="-322" rx="27" ry="18"/> -<text text-anchor="middle" x="155" y="-316.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store22->new9 --> -<g id="edge19" class="edge"> -<title>Store22->new9</title> -<path fill="none" stroke="black" d="M137.84,-335.86C126.26,-345.54 111.73,-359.88 104,-376 93.96,-396.94 78.72,-547.81 72.64,-611.62"/> -<polygon fill="black" stroke="black" points="69.18,-611.02 71.72,-621.31 76.15,-611.68 69.18,-611.02"/> -<text text-anchor="middle" x="135.59" y="-338.01" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store22->Store14 --> -<g id="edge18" class="edge"> -<title>Store22->Store14</title> -<path fill="none" stroke="blue" d="M168.75,-337.93C176.96,-347.9 186.62,-361.75 191,-376 200.34,-406.37 195.4,-443.02 189.86,-467.76"/> -<polygon fill="blue" stroke="blue" points="186.48,-466.85 187.51,-477.4 193.28,-468.51 186.48,-466.85"/> -<text text-anchor="middle" x="166.5" y="-340.08" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store22->Load16 --> -<g id="edge21" class="edge"> -<title>Store22->Load16</title> -<path fill="none" stroke="black" d="M137.39,-335.93C122.95,-346.57 102.04,-362.12 84,-376 78.96,-379.88 73.61,-384.06 68.5,-388.1"/> -<polygon fill="black" stroke="black" points="66.51,-385.21 60.86,-394.17 70.86,-390.69 66.51,-385.21"/> -<text text-anchor="middle" x="139.64" y="-338.08" font-family="Helvetica,sans-Serif" font-size="8.00">4</text> -</g> -<!-- Store22->If17 --> -<g id="edge17" class="edge"> -<title>Store22->If17:p0</title> -<path fill="none" stroke="red" d="M169.18,-337.47C184.82,-353.32 209.52,-378.02 222.95,-389.7"/> -<polygon fill="red" stroke="red" points="220.62,-392.34 230.77,-395.36 224.72,-386.67 220.62,-392.34"/> -<text text-anchor="middle" x="171.43" y="-339.62" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store22->Con_21 --> -<g id="edge20" class="edge"> -<title>Store22->Con_21</title> -<path fill="none" stroke="black" d="M155,-340.3C155,-351.66 155,-366.78 155,-379.9"/> -<polygon fill="black" stroke="black" points="151.5,-379.71 155,-389.71 158.5,-379.71 151.5,-379.71"/> -<text text-anchor="middle" x="152.75" y="-342.45" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Region23->If17 --> -<g id="edge22" class="edge"> -<title>Region23->If17:p0</title> -<path fill="none" stroke="red" d="M252.1,-268.21C250.96,-291.28 249.12,-333.83 248.8,-372.64"/> -<polygon fill="red" stroke="red" points="245.3,-372.47 248.76,-382.49 252.3,-372.5 245.3,-372.47"/> -<text text-anchor="middle" x="249.85" y="-270.36" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region23->If17 --> -<g id="edge23" class="edge"> -<title>Region23->If17:p1</title> -<path fill="none" stroke="red" d="M259.4,-268.46C262.95,-278.7 267.2,-291.95 270,-304 277.21,-335.04 280.87,-345.68 281.61,-372.75"/> -<polygon fill="red" stroke="red" points="278.11,-372.53 281.73,-382.49 285.11,-372.44 278.11,-372.53"/> -<text text-anchor="middle" x="257.15" y="-270.61" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_224->Store14 --> -<g id="edge26" class="edge"> -<title>Phi_224->Store14</title> -<path fill="none" stroke="blue" d="M170.61,-267.54C186.09,-286.03 205.55,-316.46 191,-340 172.19,-370.43 137.81,-345.57 119,-376 103.34,-401.33 106.43,-416 119,-443 125.92,-457.87 139.3,-470.06 151.95,-478.98"/> -<polygon fill="blue" stroke="blue" points="149.82,-481.77 160.1,-484.33 153.66,-475.91 149.82,-481.77"/> -<text text-anchor="middle" x="168.36" y="-269.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_224->Store22 --> -<g id="edge25" class="edge"> -<title>Phi_224->Store22</title> -<path fill="none" stroke="blue" d="M155,-268.3C155,-275.59 155,-284.27 155,-292.46"/> -<polygon fill="blue" stroke="blue" points="151.5,-292.38 155,-302.38 158.5,-292.38 151.5,-292.38"/> -<text text-anchor="middle" x="152.75" y="-270.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_224->Region23 --> -<g id="edge24" class="edge"> -<title>Phi_224->Region23</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M208.21,-250C210.05,-250 211.89,-250 213.72,-250"/> -<polygon fill="black" stroke="black" points="213.49,-253.5 223.49,-250 213.49,-246.5 213.49,-253.5"/> -<text text-anchor="middle" x="210.46" y="-242.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return25->MemMerge --> -<g id="edge29" class="edge"> -<title>Return25->MemMerge</title> -<path fill="none" stroke="blue" d="M193,-124.3C193,-131.59 193,-140.27 193,-148.46"/> -<polygon fill="blue" stroke="blue" points="189.5,-148.38 193,-158.38 196.5,-148.38 189.5,-148.38"/> -<text text-anchor="middle" x="190.75" y="-126.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return25->Load16 --> -<g id="edge28" class="edge"> -<title>Return25->Load16</title> -<path fill="none" stroke="black" d="M175.65,-124.07C165.7,-134.18 153.2,-147.43 143,-160 118.45,-190.25 109.65,-196.78 93,-232 69.52,-281.67 54.98,-344.54 48,-380.27"/> -<polygon fill="black" stroke="black" points="44.61,-379.32 46.19,-389.8 51.49,-380.62 44.61,-379.32"/> -<text text-anchor="middle" x="173.4" y="-126.22" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return25->Region23 --> -<g id="edge27" class="edge"> -<title>Return25->Region23</title> -<path fill="none" stroke="red" d="M214.94,-124.32C225.23,-133.72 236.62,-146.23 243,-160 251.76,-178.89 254.09,-202.36 254.32,-220.46"/> -<polygon fill="red" stroke="red" points="250.82,-220.19 254.22,-230.23 257.82,-220.26 250.82,-220.19"/> -<text text-anchor="middle" x="212.69" y="-126.47" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="719" height="1268" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 719 1268" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,591)"><rect class="region-box" rx="8" width="336" height="470" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e1i0" d="M96,945 L96,955 L137,955 L137,993" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#1[0] → #23 · CTRL</title></path><path class="edge MEM" id="e1i1" d="M269,118 L269,138 L694,138 L694,556 L347,556 L347,955 L167,955 L167,993" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[1] → #6 · MEM</title></path><path class="edge MEM" id="e1i2" d="M248,945 L248,965 L197,965 L197,993" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[2] → #224 · MEM</title></path><path class="edge CTRL" id="e3i0" d="M126,1167 C126,1191 359.5,1194 359.5,1218" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #25 · CTRL</title></path><path class="edge CTRL" id="e9i0" d="M149,118 L149,148 L231,148 L231,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e12i0" d="M149,118 L149,252 L184,252 L184,272" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#12[0] → #5 · CTRL</title></path><path class="edge MEM" id="e12i1" d="M269,118 L269,138 L160,138 L160,232 L208,232 L208,272" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#12[1] → #6 · MEM</title></path><path class="edge DATA" id="e12i2" d="M231,222 L231,242 L232,242 L232,272" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[2] → #9 · DATA</title></path><path class="edge DATA" id="e12i3" d="M383,222 L383,252 L256,252 L256,272" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#12[3] → #11 · DATA</title></path><path class="edge CTRL" id="e13i0" d="M149,118 L149,148 L594,148 L594,262 L372,262 L372,272" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#13[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e14i0" d="M149,118 L149,338 L173,338 L173,376" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #5 · CTRL</title></path><path class="edge MEM" id="e14i1" d="M220,328 L220,338 L197,338 L197,376" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#14[1] → #12 · MEM</title></path><path class="edge DATA" id="e14i2" d="M372,328 L372,348 L221,348 L221,376" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge DATA" id="e14i3" d="M524,328 L524,358 L245,358 L245,376" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[3] → #4 · DATA</title></path><path class="edge CTRL" id="e16i0" d="M149,118 L149,148 L594,148 L594,480" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #5 · CTRL</title></path><path class="edge MEM" id="e16i1" d="M209,432 L209,452 L624,452 L624,480" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#16[1] → #14 · MEM</title></path><path class="edge DATA" id="e16i2" d="M231,222 L231,242 L605,242 L605,442 L654,442 L654,480" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[2] → #9 · DATA</title></path><path class="edge CTRL" id="e17i0" d="M149,118 L149,148 L116,148 L116,625" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#17[0] → #5 · CTRL</title></path><path class="edge DATA" id="e17i1" d="M389,118 L389,128 L127,128 L127,576 L196,576 L196,625" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#17[1] → #7 · DATA</title></path><path class="edge CTRL" id="e22i0" d="M96,725 L96,745 L157,745 L157,785" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#22[0] → #8 · CTRL</title></path><path class="edge MEM" id="e22i1" d="M209,432 L209,452 L138,452 L138,566 L292,566 L292,745 L177,745 L177,785" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#22[1] → #14 · MEM</title></path><path class="edge DATA" id="e22i2" d="M231,222 L231,242 L138,242 L138,442 L149,442 L149,556 L303,556 L303,755 L197,755 L197,785" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[2] → #9 · DATA</title></path><path class="edge DATA" id="e22i3" d="M266,536 L266,546 L314,546 L314,765 L217,765 L217,785" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[3] → #21 · DATA</title></path><path class="edge DATA" id="e22i4" d="M624,536 L624,546 L325,546 L325,775 L237,775 L237,785" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#22[4] → #16 · DATA</title></path><path class="edge CTRL" id="e23i1" d="M96,725 L96,889" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[1] → #8 · CTRL</title></path><path class="edge CTRL" id="e23i2" d="M216,725 L216,735 L126,735 L126,889" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[2] → #10 · CTRL</title></path><path class="edge CTRL" id="e25i0" d="M96,945 L96,1114" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #23 · CTRL</title></path><path class="edge MEM" id="e25i1" d="M167,1049 L167,1076 L126,1076 L126,1114" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#25[1] → #1 · MEM</title></path><path class="edge DATA" id="e25i2" d="M624,536 L624,1086 L156,1086 L156,1114" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[2] → #16 · DATA</title></path><path class="edge MEM" id="e224i1" d="M197,841 L197,851 L228,851 L228,889" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#224[1] → #22 · MEM</title></path><path class="edge MEM" id="e224i2" d="M209,432 L209,452 L336,452 L336,851 L268,851 L268,889" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#224[2] → #14 · MEM</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(107,999)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 MemMerge +Type not computed + +[0] → #23 CTRL +[1] → #6 MEM +[2] → #224 MEM</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(89,24)" style="opacity: 1;"><path class="box" d="M0,0H360V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="180" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="180"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(323.5,1218)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #25 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(464,278)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(89,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(209,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEM</title></g><g class="node" id="n7" data-id="7" transform="translate(329,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #7/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n8" data-id="8" transform="translate(36,675)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(171,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n10" data-id="10" transform="translate(156,675)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #10/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 False +Projection 1 of #17 +Type not computed + +[0] → #17 CTRL</title></g><g class="node" id="n11" data-id="11" transform="translate(323,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#2</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 #2 +Type not computed + +</title></g><g class="node" id="n12" data-id="12" transform="translate(160,278)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #12</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 .f = +Type not computed + +[0] → #5 CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #11 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n13" data-id="13" transform="translate(312,278)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n14" data-id="14" transform="translate(149,382)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 .f = +Type not computed + +[0] → #5 CTRL +[1] → #12 MEM +[2] → #13 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n16" data-id="16" transform="translate(564,486)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#16 .f +Type not computed + +[0] → #5 CTRL +[1] → #14 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n17" data-id="17" transform="translate(36,631)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#17 If +Type not computed + +[0] → #5 CTRL +[1] → #7 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n21" data-id="21" transform="translate(206,486)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 #1 +Type not computed + +</title></g><g class="node" id="n22" data-id="22" transform="translate(137,791)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 .f = +Type not computed + +[0] → #8 CTRL +[1] → #14 MEM +[2] → #9 DATA +[3] → #21 DATA +[4] → #16 DATA</title><circle class="port" cx="20" cy="-3" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="100" cy="-3" r="3" fill="#536477"/><text class="slot" x="20" y="-10" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="60" y="-10" text-anchor="middle">2</text><text class="slot" x="80" y="-10" text-anchor="middle">3</text><text class="slot" x="100" y="-10" text-anchor="middle">4</text></g><g class="node" id="n23" data-id="23" transform="translate(36,895)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 Region +Type not computed + +[0] → — DATA +[1] → #8 CTRL +[2] → #10 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n25" data-id="25" transform="translate(66,1120)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#25 Return +Type not computed + +[0] → #23 CTRL +[1] → #1 MEM +[2] → #16 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n224" data-id="224" transform="translate(188,895)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #224</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#224 MemPhi_2 +Type not computed + +[0] → #23 ASSOC +[1] → #22 MEM +[2] → #14 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #23</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,591)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #17</tspan></text><title>If · 7 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #17"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph4.json b/chapter11/docs/graph4.json new file mode 100644 index 00000000..b021c03f --- /dev/null +++ b/chapter11/docs/graph4.json @@ -0,0 +1,42 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph4.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 37, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": {"par": 16, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 32, "role": "CTRL", "label": null}], "proj": null}, + {"id": 12, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": {"par": 16, "idx": 1}}, + {"id": 13, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 35, "role": "DATA", "label": null}], "proj": null}, + {"id": 14, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 0}}, + {"id": 16, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 1}}, + {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 23, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "#5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 25, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 23, "role": "DATA", "label": null}], "proj": null}, + {"id": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 230, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 32, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 15, "role": "CTRL", "label": null}, {"idx": 2, "def": 17, "role": "CTRL", "label": null}], "proj": null}, + {"id": 35, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 36, "role": "DATA", "label": null}], "proj": null}, + {"id": 36, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 230, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 233, "role": "MEM", "label": null}], "proj": null}, + {"id": 233, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 32, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + {"id": 11, "par": 0, "nodes": [8, 10, 11, 12, 13, 14, 16, 35, 230]}, + {"id": 25, "par": 11, "nodes": [15, 17, 21, 23, 25, 31, 32, 233]} + ] +} diff --git a/chapter11/docs/graph4.svg b/chapter11/docs/graph4.svg index 2730813a..c268b4e9 100644 --- a/chapter11/docs/graph4.svg +++ b/chapter11/docs/graph4.svg @@ -1,429 +1,187 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="510pt" height="689pt" - viewBox="0.00 0.00 510.00 688.57" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 684.57)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-684.57 506,-684.57 506,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-23.57 8,-672.57 494,-672.57 494,-23.57 8,-23.57"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="177.38,-634.07 177.38,-660.57 282.62,-660.57 282.62,-634.07 177.38,-634.07"/> -<polygon fill="none" stroke="black" points="177.38,-634.07 177.38,-660.57 282.62,-660.57 282.62,-634.07 177.38,-634.07"/> -<text text-anchor="start" x="217.25" y="-642.27" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="177.38,-601.57 177.38,-634.07 282.62,-634.07 282.62,-601.57 177.38,-601.57"/> -<polygon fill="yellow" stroke="none" points="182.38,-606.57 182.38,-629.07 213.12,-629.07 213.12,-606.57 182.38,-606.57"/> -<polygon fill="none" stroke="black" points="182.38,-606.57 182.38,-629.07 213.12,-629.07 213.12,-606.57 182.38,-606.57"/> -<text text-anchor="start" x="185.38" y="-612.77" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="213.12,-606.57 213.12,-629.07 254.38,-629.07 254.38,-606.57 213.12,-606.57"/> -<text text-anchor="start" x="216.12" y="-612.77" font-family="Times New Roman,serif" font-size="14.00">$mem</text> -<polygon fill="none" stroke="black" points="254.38,-606.57 254.38,-629.07 277.62,-629.07 277.62,-606.57 254.38,-606.57"/> -<text text-anchor="start" x="257.38" y="-612.77" font-family="Times New Roman,serif" font-size="14.00">arg</text> -</g> -<!-- MemMerge --> -<g id="node2" class="node"> -<title>MemMerge</title> -<polygon fill="none" stroke="black" points="190,-345.57 108,-345.57 108,-309.57 190,-309.57 190,-345.57"/> -<text text-anchor="middle" x="149" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> -</g> -<!-- MemMerge->Start2 --> -<g id="edge37" class="edge"> -<title>MemMerge->Start2:p1</title> -<path fill="none" stroke="blue" d="M182.26,-345.95C196.56,-354.9 212.4,-367 223,-381.57 271.6,-448.32 296.36,-483.66 269,-561.57 262.19,-580.96 242.83,-581.28 236.1,-594.6"/> -<polygon fill="blue" stroke="blue" points="232.74,-593.57 234.07,-604.09 239.58,-595.04 232.74,-593.57"/> -<text text-anchor="middle" x="180.01" y="-348.1" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230 --> -<g id="node16" class="node"> -<title>Phi_230</title> -<ellipse fill="lightyellow" stroke="black" cx="161" cy="-399.57" rx="52.89" ry="18"/> -<text text-anchor="middle" x="161" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- MemMerge->Phi_230 --> -<g id="edge38" class="edge"> -<title>MemMerge->Phi_230</title> -<path fill="none" stroke="blue" d="M151.97,-345.87C153.23,-353.24 154.74,-362.04 156.16,-370.32"/> -<polygon fill="blue" stroke="blue" points="152.67,-370.7 157.81,-379.97 159.57,-369.52 152.67,-370.7"/> -<text text-anchor="middle" x="149.72" y="-348.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="194,-67.57 140,-67.57 140,-31.57 194,-31.57 194,-67.57"/> -<text text-anchor="middle" x="167" y="-44.52" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return37 --> -<g id="node22" class="node"> -<title>Return37</title> -<polygon fill="yellow" stroke="black" points="183,-155.07 129,-155.07 129,-119.07 183,-119.07 183,-155.07"/> -<text text-anchor="middle" x="156" y="-132.02" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return37 --> -<g id="edge1" class="edge"> -<title>Stop3->Return37</title> -<path fill="none" stroke="red" d="M164.77,-67.87C163.31,-79.22 161.37,-94.35 159.68,-107.47"/> -<polygon fill="red" stroke="red" points="156.22,-106.92 158.42,-117.29 163.16,-107.82 156.22,-106.92"/> -<text text-anchor="middle" x="162.52" y="-70.02" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="233" cy="-543.57" rx="27" ry="18"/> -<text text-anchor="middle" x="233" y="-538.52" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- new9 --> -<g id="node5" class="node"> -<title>new9</title> -<ellipse fill="none" stroke="black" cx="134" cy="-543.57" rx="33.95" ry="18"/> -<text text-anchor="middle" x="134" y="-538.52" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new9->Start2 --> -<g id="edge2" class="edge"> -<title>new9->Start2:p0</title> -<path fill="none" stroke="green" d="M137.27,-561.92C141.67,-580.29 151.26,-607.68 170.22,-615.6"/> -<polygon fill="green" stroke="green" points="169.4,-619 179.89,-617.52 170.76,-612.14 169.4,-619"/> -<text text-anchor="middle" x="135.02" y="-564.07" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store10 --> -<g id="node6" class="node"> -<title>Store10</title> -<ellipse fill="none" stroke="black" cx="174" cy="-471.57" rx="27" ry="18"/> -<text text-anchor="middle" x="174" y="-466.52" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store10->Start2 --> -<g id="edge3" class="edge"> -<title>Store10->Start2:p1</title> -<path fill="none" stroke="blue" d="M176.14,-489.77C178.97,-508.31 185.04,-538.28 197,-561.57 206.55,-580.16 225.16,-580.71 231.54,-594.37"/> -<polygon fill="blue" stroke="blue" points="228.09,-594.95 233.46,-604.08 234.95,-593.59 228.09,-594.95"/> -<text text-anchor="middle" x="173.89" y="-491.92" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Store10->Con_4 --> -<g id="edge5" class="edge"> -<title>Store10->Con_4</title> -<path fill="none" stroke="black" d="M186.8,-487.75C194.46,-496.84 204.35,-508.57 213.01,-518.85"/> -<polygon fill="black" stroke="black" points="210.13,-520.86 219.25,-526.25 215.48,-516.35 210.13,-520.86"/> -<text text-anchor="middle" x="184.55" y="-489.9" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store10->new9 --> -<g id="edge4" class="edge"> -<title>Store10->new9</title> -<path fill="none" stroke="black" d="M164.72,-488.8C160.09,-496.9 154.38,-506.9 149.14,-516.07"/> -<polygon fill="black" stroke="black" points="146.18,-514.2 144.26,-524.62 152.26,-517.67 146.18,-514.2"/> -<text text-anchor="middle" x="162.47" y="-490.95" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Loop11 --> -<g id="node7" class="node"> -<title>Loop11</title> -<polygon fill="yellow" stroke="black" points="326,-417.57 272,-417.57 272,-381.57 326,-381.57 326,-417.57"/> -<text text-anchor="middle" x="299" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop11->Start2 --> -<g id="edge6" class="edge"> -<title>Loop11->Start2:p0</title> -<path fill="none" stroke="red" d="M302.41,-417.85C307.63,-449.41 314.1,-517.19 284,-561.57 262.39,-593.42 210.43,-569.06 199.7,-594.37"/> -<polygon fill="red" stroke="red" points="196.28,-593.62 198.01,-604.07 203.18,-594.83 196.28,-593.62"/> -<text text-anchor="middle" x="300.16" y="-420" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32 --> -<g id="node18" class="node"> -<title>Region32</title> -<polygon fill="yellow" stroke="black" points="277.5,-67.57 222.5,-67.57 222.5,-31.57 277.5,-31.57 277.5,-67.57"/> -<text text-anchor="middle" x="250" y="-44.52" font-family="Times New Roman,serif" font-size="14.00">Region</text> -</g> -<!-- Loop11->Region32 --> -<g id="edge7" class="edge"> -<title>Loop11->Region32</title> -<path fill="none" stroke="red" d="M294.37,-381.1C287.79,-356.73 275.97,-314.9 271,-309.57 241.37,-277.72 212.98,-301.92 180,-273.57 139.82,-239.03 133.81,-221.71 120,-170.57 112.24,-141.82 103.39,-128.28 120,-103.57 122.76,-99.46 174.37,-79.22 211.72,-64.98"/> -<polygon fill="red" stroke="red" points="212.79,-68.32 220.89,-61.49 210.3,-61.77 212.79,-68.32"/> -<text text-anchor="middle" x="292.12" y="-373.5" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg13 --> -<g id="node8" class="node"> -<title>Phi_arg13</title> -<ellipse fill="lightyellow" stroke="black" cx="377" cy="-399.57" rx="32.93" ry="18"/> -<text text-anchor="middle" x="377" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg13->Start2 --> -<g id="edge9" class="edge"> -<title>Phi_arg13->Start2:p2</title> -<path fill="none" stroke="black" d="M377.05,-417.98C376.25,-467.21 367.08,-604.69 289.96,-616.94"/> -<polygon fill="black" stroke="black" points="289.83,-613.44 280.13,-617.7 290.37,-620.42 289.83,-613.44"/> -<text text-anchor="middle" x="374.8" y="-420.13" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg13->Loop11 --> -<g id="edge8" class="edge"> -<title>Phi_arg13->Loop11</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M343.81,-399.57C341.82,-399.57 339.82,-399.57 337.83,-399.57"/> -<polygon fill="black" stroke="black" points="337.94,-396.07 327.94,-399.57 337.94,-403.07 337.94,-396.07"/> -<text text-anchor="middle" x="341.56" y="-391.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35 --> -<g id="node20" class="node"> -<title>Sub35</title> -<ellipse fill="none" stroke="black" cx="459" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="459" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">-</text> -</g> -<!-- LT14 --> -<g id="node9" class="node"> -<title>LT14</title> -<ellipse fill="none" stroke="black" cx="235" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="235" y="-322.52" font-family="Times New Roman,serif" font-size="14.00"><</text> -</g> -<!-- LT14->Con_4 --> -<g id="edge11" class="edge"> -<title>LT14->Con_4</title> -<path fill="none" stroke="black" d="M234.84,-345.72C234.5,-382.42 233.69,-468.91 233.27,-514.03"/> -<polygon fill="black" stroke="black" points="229.77,-513.79 233.18,-523.82 236.77,-513.85 229.77,-513.79"/> -<text text-anchor="middle" x="232.59" y="-347.87" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT14->Phi_arg13 --> -<g id="edge12" class="edge"> -<title>LT14->Phi_arg13</title> -<path fill="none" stroke="black" d="M256.26,-339.05C279.21,-350.36 316.09,-368.54 343.06,-381.84"/> -<polygon fill="black" stroke="black" points="341.35,-384.89 351.86,-386.17 344.44,-378.61 341.35,-384.89"/> -<text text-anchor="middle" x="258.51" y="-341.2" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If16 --> -<g id="node10" class="node"> -<title>If16</title> -<polygon fill="yellow" stroke="none" points="197,-243.07 197,-269.57 273,-269.57 273,-243.07 197,-243.07"/> -<polygon fill="none" stroke="black" points="197,-243.07 197,-269.57 273,-269.57 273,-243.07 197,-243.07"/> -<text text-anchor="start" x="230.5" y="-251.27" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="197,-210.57 197,-243.07 273,-243.07 273,-210.57 197,-210.57"/> -<polygon fill="yellow" stroke="none" points="202,-215.57 202,-238.07 233.5,-238.07 233.5,-215.57 202,-215.57"/> -<polygon fill="none" stroke="black" points="202,-215.57 202,-238.07 233.5,-238.07 233.5,-215.57 202,-215.57"/> -<text text-anchor="start" x="205" y="-221.77" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="233.5,-215.57 233.5,-238.07 268,-238.07 268,-215.57 233.5,-215.57"/> -<polygon fill="none" stroke="black" points="233.5,-215.57 233.5,-238.07 268,-238.07 268,-215.57 233.5,-215.57"/> -<text text-anchor="start" x="236.5" y="-221.77" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If16->Loop11 --> -<g id="edge13" class="edge"> -<title>If16->Loop11</title> -<path fill="none" stroke="red" d="M264.28,-273.52C272.55,-284.3 280.73,-296.83 286,-309.57 293.91,-328.67 297.12,-351.83 298.37,-369.73"/> -<polygon fill="red" stroke="red" points="294.87,-369.85 298.88,-379.66 301.86,-369.5 294.87,-369.85"/> -<text text-anchor="middle" x="262.03" y="-275.67" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If16->LT14 --> -<g id="edge14" class="edge"> -<title>If16->LT14</title> -<path fill="none" stroke="black" d="M235,-273.39C235,-281.55 235,-290.26 235,-298.21"/> -<polygon fill="black" stroke="black" points="231.5,-298.02 235,-308.02 238.5,-298.02 231.5,-298.02"/> -<text text-anchor="middle" x="232.75" y="-275.54" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Div21 --> -<g id="node11" class="node"> -<title>Div21</title> -<ellipse fill="none" stroke="black" cx="43" cy="-399.57" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">//</text> -</g> -<!-- Div21->Start2 --> -<g id="edge15" class="edge"> -<title>Div21->Start2:p2</title> -<path fill="none" stroke="black" d="M56.22,-415.68C64.22,-425.72 73.84,-439.58 79,-453.57 95.73,-498.87 59.24,-525.18 91,-561.57 140.95,-618.8 253.3,-535.12 265.01,-594.3"/> -<polygon fill="black" stroke="black" points="261.5,-594.4 265.87,-604.06 268.48,-593.79 261.5,-594.4"/> -<text text-anchor="middle" x="58.47" y="-417.83" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_22 --> -<g id="node12" class="node"> -<title>Con_22</title> -<ellipse fill="none" stroke="black" cx="43" cy="-471.57" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-466.52" font-family="Times New Roman,serif" font-size="14.00">#3</text> -</g> -<!-- Div21->Con_22 --> -<g id="edge16" class="edge"> -<title>Div21->Con_22</title> -<path fill="none" stroke="black" d="M43,-417.87C43,-425.16 43,-433.84 43,-442.03"/> -<polygon fill="black" stroke="black" points="39.5,-441.95 43,-451.95 46.5,-441.95 39.5,-441.95"/> -<text text-anchor="middle" x="40.75" y="-420.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- EQ23 --> -<g id="node13" class="node"> -<title>EQ23</title> -<ellipse fill="none" stroke="black" cx="346" cy="-240.07" rx="27" ry="18"/> -<text text-anchor="middle" x="346" y="-235.02" font-family="Times New Roman,serif" font-size="14.00">==</text> -</g> -<!-- EQ23->Phi_arg13 --> -<g id="edge17" class="edge"> -<title>EQ23->Phi_arg13</title> -<path fill="none" stroke="black" d="M344.71,-258.4C343.62,-279.39 343.3,-315.66 351,-345.57 353.31,-354.54 357.23,-363.78 361.33,-371.99"/> -<polygon fill="black" stroke="black" points="358.21,-373.56 366.01,-380.73 364.38,-370.26 358.21,-373.56"/> -<text text-anchor="middle" x="342.46" y="-260.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_24 --> -<g id="node14" class="node"> -<title>Con_24</title> -<ellipse fill="none" stroke="black" cx="387" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="387" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">#5</text> -</g> -<!-- EQ23->Con_24 --> -<g id="edge18" class="edge"> -<title>EQ23->Con_24</title> -<path fill="none" stroke="black" d="M353.91,-257.55C359.69,-269.62 367.66,-286.24 374.33,-300.14"/> -<polygon fill="black" stroke="black" points="370.98,-301.26 378.46,-308.77 377.3,-298.24 370.98,-301.26"/> -<text text-anchor="middle" x="351.66" y="-259.7" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If25 --> -<g id="node15" class="node"> -<title>If25</title> -<polygon fill="yellow" stroke="none" points="229,-140.07 229,-166.57 305,-166.57 305,-140.07 229,-140.07"/> -<polygon fill="none" stroke="black" points="229,-140.07 229,-166.57 305,-166.57 305,-140.07 229,-140.07"/> -<text text-anchor="start" x="262.5" y="-148.27" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="229,-107.57 229,-140.07 305,-140.07 305,-107.57 229,-107.57"/> -<polygon fill="yellow" stroke="none" points="234,-112.57 234,-135.07 265.5,-135.07 265.5,-112.57 234,-112.57"/> -<polygon fill="none" stroke="black" points="234,-112.57 234,-135.07 265.5,-135.07 265.5,-112.57 234,-112.57"/> -<text text-anchor="start" x="237" y="-118.77" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="265.5,-112.57 265.5,-135.07 300,-135.07 300,-112.57 265.5,-112.57"/> -<polygon fill="none" stroke="black" points="265.5,-112.57 265.5,-135.07 300,-135.07 300,-112.57 265.5,-112.57"/> -<text text-anchor="start" x="268.5" y="-118.77" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If25->If16 --> -<g id="edge19" class="edge"> -<title>If25->If16:p0</title> -<path fill="none" stroke="red" d="M234.98,-170.32C227.77,-180.06 221.5,-191.38 218.96,-203.38"/> -<polygon fill="red" stroke="red" points="215.51,-202.74 217.91,-213.06 222.47,-203.49 215.51,-202.74"/> -<text text-anchor="middle" x="232.73" y="-172.47" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If25->EQ23 --> -<g id="edge20" class="edge"> -<title>If25->EQ23</title> -<path fill="none" stroke="black" d="M292.21,-170.3C303.4,-184.61 316.37,-201.18 326.76,-214.47"/> -<polygon fill="black" stroke="black" points="323.96,-216.57 332.88,-222.29 329.48,-212.26 323.96,-216.57"/> -<text text-anchor="middle" x="289.96" y="-172.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230->Store10 --> -<g id="edge22" class="edge"> -<title>Phi_230->Store10</title> -<path fill="none" stroke="blue" d="M164.21,-417.87C165.58,-425.24 167.22,-434.04 168.75,-442.32"/> -<polygon fill="blue" stroke="blue" points="165.28,-442.78 170.55,-451.97 172.16,-441.5 165.28,-442.78"/> -<text text-anchor="middle" x="161.96" y="-420.02" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230->Loop11 --> -<g id="edge21" class="edge"> -<title>Phi_230->Loop11</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M214.37,-399.57C229.71,-399.57 245.05,-399.57 260.39,-399.57"/> -<polygon fill="black" stroke="black" points="260.05,-403.07 270.05,-399.57 260.05,-396.07 260.05,-403.07"/> -<text text-anchor="middle" x="216.62" y="-391.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_233 --> -<g id="node19" class="node"> -<title>Phi_233</title> -<ellipse fill="lightyellow" stroke="black" cx="69" cy="-49.57" rx="52.89" ry="18"/> -<text text-anchor="middle" x="69" y="-44.52" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- Store31 --> -<g id="node17" class="node"> -<title>Store31</title> -<ellipse fill="none" stroke="black" cx="43" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store31->new9 --> -<g id="edge25" class="edge"> -<title>Store31->new9</title> -<path fill="none" stroke="black" d="M56.48,-343.35C67.65,-356.68 82.68,-377.39 89,-398.57"/> -<path fill="none" stroke="black" d="M89,-400.57C100.9,-440.42 115.61,-486.25 124.9,-514.81"/> -<polygon fill="black" stroke="black" points="121.51,-515.71 127.94,-524.13 128.17,-513.54 121.51,-515.71"/> -<text text-anchor="middle" x="58.73" y="-345.5" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store31->Div21 --> -<g id="edge26" class="edge"> -<title>Store31->Div21</title> -<path fill="none" stroke="black" d="M43,-345.87C43,-353.16 43,-361.84 43,-370.03"/> -<polygon fill="black" stroke="black" points="39.5,-369.95 43,-379.95 46.5,-369.95 39.5,-369.95"/> -<text text-anchor="middle" x="40.75" y="-348.02" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store31->Phi_230 --> -<g id="edge24" class="edge"> -<title>Store31->Phi_230</title> -<path fill="none" stroke="blue" d="M62.75,-340.28C79.89,-350.45 105.12,-365.42 125.72,-377.64"/> -<polygon fill="blue" stroke="blue" points="123.72,-380.52 134.1,-382.61 127.29,-374.5 123.72,-380.52"/> -<text text-anchor="middle" x="65" y="-342.43" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32->If25 --> -<g id="edge27" class="edge"> -<title>Region32->If25:p0</title> -<path fill="none" stroke="red" d="M249.89,-67.92C249.84,-77.07 249.79,-88.77 249.76,-100.25"/> -<polygon fill="red" stroke="red" points="246.26,-100.05 249.75,-110.05 253.26,-100.06 246.26,-100.05"/> -<text text-anchor="middle" x="247.64" y="-70.07" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32->If25 --> -<g id="edge28" class="edge"> -<title>Region32->If25:p1</title> -<path fill="none" stroke="red" d="M265.22,-67.95C271.77,-76.79 278.57,-88.22 281.39,-100.32"/> -<polygon fill="red" stroke="red" points="277.9,-100.55 282.57,-110.06 284.84,-99.72 277.9,-100.55"/> -<text text-anchor="middle" x="262.97" y="-70.1" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_233->Phi_230 --> -<g id="edge31" class="edge"> -<title>Phi_233->Phi_230</title> -<path fill="none" stroke="blue" d="M117.06,-66.52C146.85,-77.29 181.4,-91.65 192,-103.57 212.65,-126.78 191.64,-147.08 212,-170.57 237.01,-199.41 269.42,-174.4 290,-206.57 323.6,-259.09 310.68,-297.47 271,-345.57 256.18,-363.53 233.82,-375.83 213.13,-384.03"/> -<polygon fill="blue" stroke="blue" points="118.37,-63.28 107.78,-63.24 116.04,-69.87 118.37,-63.28"/> -<polygon fill="blue" stroke="blue" points="212.09,-380.68 203.93,-387.42 214.52,-387.25 212.09,-380.68"/> -<text text-anchor="middle" x="108.6" y="-64.88" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_233->Store31 --> -<g id="edge30" class="edge"> -<title>Phi_233->Store31</title> -<path fill="none" stroke="blue" d="M67.37,-67.83C63.02,-114.01 51.09,-240.72 45.7,-297.9"/> -<polygon fill="blue" stroke="blue" points="42.22,-297.52 44.77,-307.8 49.19,-298.17 42.22,-297.52"/> -<text text-anchor="middle" x="65.12" y="-69.98" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_233->Region32 --> -<g id="edge29" class="edge"> -<title>Phi_233->Region32</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M89.57,-32.51C103.01,-22.52 121.45,-10.85 140,-5.57 163.08,1.01 171.32,2.28 194,-5.57 205.22,-9.45 215.9,-16.6 224.86,-24.03"/> -<polygon fill="black" stroke="black" points="222.28,-26.42 232.09,-30.44 226.93,-21.19 222.28,-26.42"/> -<text text-anchor="middle" x="87.32" y="-24.91" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35->Phi_arg13 --> -<g id="edge32" class="edge"> -<title>Sub35->Phi_arg13</title> -<path fill="none" stroke="black" d="M434.35,-349.61C424.46,-358.05 413.06,-367.79 403.03,-376.34"/> -<polygon fill="black" stroke="black" points="436.32,-352.53 441.65,-343.38 431.77,-347.21 436.32,-352.53"/> -<polygon fill="black" stroke="black" points="400.78,-373.66 395.45,-382.82 405.33,-378.98 400.78,-373.66"/> -<text text-anchor="middle" x="440.55" y="-344.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_36 --> -<g id="node21" class="node"> -<title>Con_36</title> -<ellipse fill="none" stroke="black" cx="459" cy="-399.57" rx="27" ry="18"/> -<text text-anchor="middle" x="459" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">#1</text> -</g> -<!-- Sub35->Con_36 --> -<g id="edge33" class="edge"> -<title>Sub35->Con_36</title> -<path fill="none" stroke="black" d="M459,-345.87C459,-353.16 459,-361.84 459,-370.03"/> -<polygon fill="black" stroke="black" points="455.5,-369.95 459,-379.95 462.5,-369.95 455.5,-369.95"/> -<text text-anchor="middle" x="456.75" y="-348.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return37->MemMerge --> -<g id="edge36" class="edge"> -<title>Return37->MemMerge</title> -<path fill="none" stroke="blue" d="M89,-241.07C86.12,-264.36 101.49,-285.96 117.39,-301.62"/> -<polygon fill="blue" stroke="blue" points="114.82,-304.01 124.55,-308.22 119.57,-298.86 114.82,-304.01"/> -<text text-anchor="middle" x="86.75" y="-233.47" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return37->new9 --> -<g id="edge35" class="edge"> -<title>Return37->new9</title> -<path fill="none" stroke="black" d="M89,-241.07C84.7,-275.8 78.53,-365.17 89,-398.57"/> -<path fill="none" stroke="black" d="M137.42,-155.26C119.26,-173.82 93.67,-205.3 89,-239.07"/> -<text text-anchor="middle" x="86.75" y="-243.22" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return37->If16 --> -<g id="edge34" class="edge"> -<title>Return37->If16:p1</title> -<path fill="none" stroke="red" d="M177.98,-155.47C198.53,-171.78 228.14,-195.38 242.42,-207.22"/> -<polygon fill="red" stroke="red" points="239.8,-209.58 249.61,-213.56 244.43,-204.33 239.8,-209.58"/> -<text text-anchor="middle" x="175.73" y="-157.62" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="890" height="1532" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 890 1532" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(41,277)"><rect class="region-box" rx="8" width="803" height="944" fill="#f1f6fc"/></g><g class="region" transform="translate(276,800)"><rect class="region-box" rx="8" width="503" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge MEM" id="e1i1" d="M275,118 L275,128 L854,128 L854,1236 L795,1236 L795,1274" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[1] → #6 · MEM</title></path><path class="edge MEM" id="e1i2" d="M459,495 L459,505 L789,505 L789,1246 L825,1246 L825,1274" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[2] → #230 · MEM</title></path><path class="edge CTRL" id="e3i0" d="M285,1431 C285,1455 445,1458 445,1482" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #37 · CTRL</title></path><path class="edge CTRL" id="e9i0" d="M155,118 L155,148 L530,148 L530,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge MEM" id="e10i1" d="M275,118 L275,128 L307,128 L307,262 L427,262 L427,335" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#10[1] → #6 · MEM</title></path><path class="edge DATA" id="e10i2" d="M530,222 L530,232 L451,232 L451,335" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge DATA" id="e10i3" d="M237,222 L237,252 L475,252 L475,335" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[3] → #4 · DATA</title></path><path class="edge CTRL" id="e11i1" d="M155,118 L155,439" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e11i2" d="M438,1139 L438,1149 L832,1149 L832,414 L185,414 L185,442" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[2] → #32 · CTRL</title></path><path class="edge DATA" id="e13i1" d="M395,118 L395,138 L166,138 L166,262 L287,262 L287,439" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[1] → #7 · DATA</title></path><path class="edge DATA" id="e13i2" d="M378,596 L378,606 L822,606 L822,422 L327,422 L327,442" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[2] → #35 · DATA</title></path><path class="edge DATA" id="e14i1" d="M237,222 L237,252 L73,252 L73,515 L226,515 L226,543" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #4 · DATA</title></path><path class="edge DATA" id="e14i2" d="M307,495 L307,515 L256,515 L256,543" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge CTRL" id="e16i0" d="M155,495 L155,647" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #11 · CTRL</title></path><path class="edge DATA" id="e16i1" d="M226,599 L226,609 L235,609 L235,647" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #14 · DATA</title></path><path class="edge DATA" id="e21i1" d="M395,118 L395,138 L655,138 L655,242 L696,242 L696,834" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #7 · DATA</title></path><path class="edge DATA" id="e21i2" d="M726,222 L726,834" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[2] → #22 · DATA</title></path><path class="edge DATA" id="e23i1" d="M307,495 L307,515 L448,515 L448,834" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[1] → #13 · DATA</title></path><path class="edge DATA" id="e23i2" d="M378,222 L378,242 L539,242 L539,757 L478,757 L478,834" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[2] → #24 · DATA</title></path><path class="edge CTRL" id="e25i0" d="M135,747 L135,757 L368,757 L368,938" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #8 · CTRL</title></path><path class="edge DATA" id="e25i1" d="M448,890 L448,938" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[1] → #23 · DATA</title></path><path class="edge MEM" id="e31i1" d="M459,495 L459,505 L614,505 L614,949" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#31[1] → #230 · MEM</title></path><path class="edge DATA" id="e31i2" d="M530,222 L530,232 L625,232 L625,900 L638,900 L638,949" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[2] → #9 · DATA</title></path><path class="edge DATA" id="e31i3" d="M696,890 L696,900 L662,900 L662,949" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[3] → #21 · DATA</title></path><path class="edge CTRL" id="e32i1" d="M348,1038 L348,1048 L438,1048 L438,1086" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#32[1] → #15 · CTRL</title></path><path class="edge CTRL" id="e32i2" d="M468,1038 L468,1086" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#32[2] → #17 · CTRL</title></path><path class="edge DATA" id="e35i1" d="M307,495 L307,515 L378,515 L378,543" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[1] → #13 · DATA</title></path><path class="edge DATA" id="e35i2" d="M84,222 L84,505 L408,505 L408,543" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[2] → #36 · DATA</title></path><path class="edge CTRL" id="e37i0" d="M255,747 L255,1378" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#37[0] → #12 · CTRL</title></path><path class="edge MEM" id="e37i1" d="M795,1330 L795,1340 L285,1340 L285,1378" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#37[1] → #1 · MEM</title></path><path class="edge DATA" id="e37i2" d="M530,222 L530,232 L865,232 L865,1350 L315,1350 L315,1378" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[2] → #9 · DATA</title></path><path class="edge MEM" id="e230i1" d="M439,391 L439,439" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#230[1] → #10 · MEM</title></path><path class="edge MEM" id="e230i2" d="M590,1139 L590,1149 L812,1149 L812,430 L479,430 L479,442" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#230[2] → #233 · MEM</title></path><path class="edge MEM" id="e233i1" d="M626,1005 L626,1048 L570,1048 L570,1086" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#233[1] → #31 · MEM</title></path><path class="edge MEM" id="e233i2" d="M459,495 L459,505 L789,505 L789,757 L766,757 L766,1058 L610,1058 L610,1086" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#233[2] → #230 · MEM</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(735,1280)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 MemMerge +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #230 MEM</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(95,24)" style="opacity: 1;"><path class="box" d="M0,0H360V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="180" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="180"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(409,1482)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #37 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(177,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(95,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(215,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEM</title></g><g class="node" id="n7" data-id="7" transform="translate(335,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #7/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n8" data-id="8" transform="translate(75,697)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #16 +Type not computed + +[0] → #16 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(470,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n10" data-id="10" transform="translate(379,341)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 .f = +Type not computed + +[0] → — DATA +[1] → #6 MEM +[2] → #9 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n11" data-id="11" transform="translate(95,445)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 Loop +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #32 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(195,697)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #12/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 False +Projection 1 of #16 +Type not computed + +[0] → #16 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(247,445)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 φ_arg +Type not computed + +[0] → #11 ASSOC +[1] → #7 DATA +[2] → #35 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #11</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n14" data-id="14" transform="translate(166,549)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 < +Type not computed + +[0] → — DATA +[1] → #4 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(288,988)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #15/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 True +Projection 0 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n16" data-id="16" transform="translate(75,653)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#16 If +Type not computed + +[0] → #11 CTRL +[1] → #14 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n17" data-id="17" transform="translate(408,988)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #17/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 False +Projection 1 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n21" data-id="21" transform="translate(636,840)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>//</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 // +Type not computed + +[0] → — DATA +[1] → #7 DATA +[2] → #22 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n22" data-id="22" transform="translate(666,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 #3 +Type not computed + +</title></g><g class="node" id="n23" data-id="23" transform="translate(388,840)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 == +Type not computed + +[0] → — DATA +[1] → #13 DATA +[2] → #24 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n24" data-id="24" transform="translate(318,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 #5 +Type not computed + +</title></g><g class="node" id="n25" data-id="25" transform="translate(288,944)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#25 If +Type not computed + +[0] → #8 CTRL +[1] → #23 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n31" data-id="31" transform="translate(566,955)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #31</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#31 .f = +Type not computed + +[0] → — DATA +[1] → #230 MEM +[2] → #9 DATA +[3] → #21 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="white"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n32" data-id="32" transform="translate(378,1092)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #32</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#32 Region +Type not computed + +[0] → — DATA +[1] → #15 CTRL +[2] → #17 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n35" data-id="35" transform="translate(318,549)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #35</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#35 - +Type not computed + +[0] → — DATA +[1] → #13 DATA +[2] → #36 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n36" data-id="36" transform="translate(24,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #36</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#36 #1 +Type not computed + +</title></g><g class="node" id="n37" data-id="37" transform="translate(225,1384)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #37</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#37 Return +Type not computed + +[0] → #12 CTRL +[1] → #1 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n230" data-id="230" transform="translate(399,445)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #230</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#230 MemPhi_2 +Type not computed + +[0] → #11 ASSOC +[1] → #10 MEM +[2] → #233 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #11</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n233" data-id="233" transform="translate(530,1092)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #233</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#233 MemPhi_2 +Type not computed + +[0] → #32 ASSOC +[1] → #31 MEM +[2] → #230 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #32</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(41,277)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #11</tspan></text><title>Loop · 17 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #11"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(276,800)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><title>If · 8 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #25"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph5.json b/chapter11/docs/graph5.json new file mode 100644 index 00000000..2211cb19 --- /dev/null +++ b/chapter11/docs/graph5.json @@ -0,0 +1,42 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph5.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 37, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": {"par": 16, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 32, "role": "CTRL", "label": null}], "proj": null}, + {"id": 12, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": {"par": 16, "idx": 1}}, + {"id": 13, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 35, "role": "DATA", "label": null}], "proj": null}, + {"id": 14, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 0}}, + {"id": 16, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 1}}, + {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 23, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "#5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 25, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 23, "role": "DATA", "label": null}], "proj": null}, + {"id": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 230, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 32, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 15, "role": "CTRL", "label": null}, {"idx": 2, "def": 17, "role": "CTRL", "label": null}], "proj": null}, + {"id": 35, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 36, "role": "DATA", "label": null}], "proj": null}, + {"id": 36, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 230, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 233, "role": "MEM", "label": null}], "proj": null}, + {"id": 233, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 32, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + {"id": 11, "par": 0, "nodes": [1, 8, 11, 12, 13, 14, 16, 23, 31, 35, 230]}, + {"id": 25, "par": 11, "nodes": [15, 17, 25, 32, 233]} + ] +} diff --git a/chapter11/docs/graph5.svg b/chapter11/docs/graph5.svg index 9336ac3e..1669e008 100644 --- a/chapter11/docs/graph5.svg +++ b/chapter11/docs/graph5.svg @@ -1,472 +1,187 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="526pt" height="689pt" - viewBox="0.00 0.00 526.00 688.57" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 684.57)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-684.57 522,-684.57 522,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-23.57 8,-672.57 510,-672.57 510,-23.57 8,-23.57"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="146.38,-634.07 146.38,-660.57 251.62,-660.57 251.62,-634.07 146.38,-634.07"/> -<polygon fill="none" stroke="black" points="146.38,-634.07 146.38,-660.57 251.62,-660.57 251.62,-634.07 146.38,-634.07"/> -<text text-anchor="start" x="186.25" y="-642.27" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="146.38,-601.57 146.38,-634.07 251.62,-634.07 251.62,-601.57 146.38,-601.57"/> -<polygon fill="yellow" stroke="none" points="151.38,-606.57 151.38,-629.07 182.12,-629.07 182.12,-606.57 151.38,-606.57"/> -<polygon fill="none" stroke="black" points="151.38,-606.57 151.38,-629.07 182.12,-629.07 182.12,-606.57 151.38,-606.57"/> -<text text-anchor="start" x="154.38" y="-612.77" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="182.12,-606.57 182.12,-629.07 223.38,-629.07 223.38,-606.57 182.12,-606.57"/> -<text text-anchor="start" x="185.12" y="-612.77" font-family="Times New Roman,serif" font-size="14.00">$mem</text> -<polygon fill="none" stroke="black" points="223.38,-606.57 223.38,-629.07 246.62,-629.07 246.62,-606.57 223.38,-606.57"/> -<text text-anchor="start" x="226.38" y="-612.77" font-family="Times New Roman,serif" font-size="14.00">arg</text> -</g> -<!-- MemMerge --> -<g id="node2" class="node"> -<title>MemMerge</title> -<polygon fill="none" stroke="black" points="190,-345.57 108,-345.57 108,-309.57 190,-309.57 190,-345.57"/> -<text text-anchor="middle" x="149" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> -</g> -<!-- MemMerge->Start2 --> -<g id="edge43" class="edge"> -<title>MemMerge->Start2:p1</title> -<path fill="none" stroke="blue" d="M157.48,-345.84C162.13,-356.02 167.63,-369.27 171,-381.57 196.5,-474.76 202.31,-502.84 202.73,-594.11"/> -<polygon fill="blue" stroke="blue" points="199.22,-594.06 202.75,-604.05 206.22,-594.04 199.22,-594.06"/> -<text text-anchor="middle" x="155.23" y="-347.99" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Loop11 --> -<g id="node7" class="node"> -<title>Loop11</title> -<polygon fill="yellow" stroke="black" points="274,-417.57 220,-417.57 220,-381.57 274,-381.57 274,-417.57"/> -<text text-anchor="middle" x="247" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">Loop</text> -</g> -<!-- MemMerge->Loop11 --> -<g id="edge45" class="edge"> -<title>MemMerge->Loop11</title> -<path fill="none" stroke="green" d="M173.48,-346.05C185.61,-354.72 200.45,-365.32 213.61,-374.72"/> -<polygon fill="green" stroke="green" points="211.43,-377.46 221.6,-380.43 215.5,-371.76 211.43,-377.46"/> -<text text-anchor="middle" x="171.23" y="-348.2" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_230 --> -<g id="node16" class="node"> -<title>Phi_230</title> -<ellipse fill="lightyellow" stroke="black" cx="109" cy="-399.57" rx="52.89" ry="18"/> -<text text-anchor="middle" x="109" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- MemMerge->Phi_230 --> -<g id="edge44" class="edge"> -<title>MemMerge->Phi_230</title> -<path fill="none" stroke="blue" d="M139.11,-345.87C134.66,-353.67 129.29,-363.06 124.33,-371.74"/> -<polygon fill="blue" stroke="blue" points="121.45,-369.73 119.52,-380.15 127.53,-373.2 121.45,-369.73"/> -<text text-anchor="middle" x="136.86" y="-348.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="194,-67.57 140,-67.57 140,-31.57 194,-31.57 194,-67.57"/> -<text text-anchor="middle" x="167" y="-44.52" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return37 --> -<g id="node22" class="node"> -<title>Return37</title> -<polygon fill="yellow" stroke="black" points="183,-155.07 129,-155.07 129,-119.07 183,-119.07 183,-155.07"/> -<text text-anchor="middle" x="156" y="-132.02" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return37 --> -<g id="edge1" class="edge"> -<title>Stop3->Return37</title> -<path fill="none" stroke="red" d="M164.77,-67.87C163.31,-79.22 161.37,-94.35 159.68,-107.47"/> -<polygon fill="red" stroke="red" points="156.22,-106.92 158.42,-117.29 163.16,-107.82 156.22,-106.92"/> -<text text-anchor="middle" x="162.52" y="-70.02" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="241" cy="-543.57" rx="27" ry="18"/> -<text text-anchor="middle" x="241" y="-538.52" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- new9 --> -<g id="node5" class="node"> -<title>new9</title> -<ellipse fill="none" stroke="black" cx="122" cy="-543.57" rx="33.95" ry="18"/> -<text text-anchor="middle" x="122" y="-538.52" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new9->Start2 --> -<g id="edge2" class="edge"> -<title>new9->Start2:p0</title> -<path fill="none" stroke="green" d="M140.72,-558.99C150.49,-567.91 161.22,-580.35 165.17,-594.47"/> -<polygon fill="green" stroke="green" points="161.67,-594.66 166.54,-604.07 168.6,-593.67 161.67,-594.66"/> -<text text-anchor="middle" x="138.47" y="-561.14" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store10 --> -<g id="node6" class="node"> -<title>Store10</title> -<ellipse fill="none" stroke="black" cx="128" cy="-471.57" rx="27" ry="18"/> -<text text-anchor="middle" x="128" y="-466.52" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store10->Start2 --> -<g id="edge3" class="edge"> -<title>Store10->Start2:p0</title> -<path fill="none" stroke="red" d="M142.02,-487.46C150.41,-497.42 160.33,-511.27 165,-525.57 174.79,-555.54 168.59,-567.3 167.06,-594.37"/> -<polygon fill="red" stroke="red" points="163.57,-593.96 166.79,-604.05 170.57,-594.15 163.57,-593.96"/> -<text text-anchor="middle" x="144.27" y="-489.61" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store10->Con_4 --> -<g id="edge6" class="edge"> -<title>Store10->Con_4</title> -<path fill="none" stroke="black" d="M147.43,-484.6C165.24,-495.63 191.86,-512.12 212.15,-524.7"/> -<polygon fill="black" stroke="black" points="210.2,-527.6 220.54,-529.89 213.88,-521.65 210.2,-527.6"/> -<text text-anchor="middle" x="149.68" y="-486.75" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store10->new9 --> -<g id="edge5" class="edge"> -<title>Store10->new9</title> -<path fill="none" stroke="black" d="M126.52,-489.87C125.89,-497.16 125.15,-505.84 124.45,-514.03"/> -<polygon fill="black" stroke="black" points="120.96,-513.69 123.6,-523.95 127.94,-514.29 120.96,-513.69"/> -<text text-anchor="middle" x="124.27" y="-492.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Loop11->Start2 --> -<g id="edge7" class="edge"> -<title>Loop11->Start2:p0</title> -<path fill="none" stroke="red" d="M257.71,-417.74C275.77,-449.11 307.46,-516.61 277,-561.57 249.83,-601.66 179.64,-560.76 168.31,-594.59"/> -<polygon fill="red" stroke="red" points="164.9,-593.67 166.96,-604.07 171.83,-594.66 164.9,-593.67"/> -<text text-anchor="middle" x="255.46" y="-419.89" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32 --> -<g id="node18" class="node"> -<title>Region32</title> -<polygon fill="yellow" stroke="black" points="277.5,-67.57 222.5,-67.57 222.5,-31.57 277.5,-31.57 277.5,-67.57"/> -<text text-anchor="middle" x="250" y="-44.52" font-family="Times New Roman,serif" font-size="14.00">Region</text> -</g> -<!-- Loop11->Region32 --> -<g id="edge8" class="edge"> -<title>Loop11->Region32</title> -<path fill="none" stroke="red" d="M259.49,-381.16C271.43,-362.17 285.63,-331.55 271,-309.57 248.04,-275.07 216.63,-300.33 185,-273.57 123.24,-221.32 74.87,-170.7 120,-103.57 122.76,-99.46 174.37,-79.22 211.72,-64.98"/> -<polygon fill="red" stroke="red" points="212.79,-68.32 220.89,-61.49 210.3,-61.77 212.79,-68.32"/> -<text text-anchor="middle" x="257.24" y="-373.56" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg13 --> -<g id="node8" class="node"> -<title>Phi_arg13</title> -<ellipse fill="lightyellow" stroke="black" cx="325" cy="-399.57" rx="32.93" ry="18"/> -<text text-anchor="middle" x="325" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg13->Start2 --> -<g id="edge10" class="edge"> -<title>Phi_arg13->Start2:p2</title> -<path fill="none" stroke="black" d="M326.47,-417.98C329.72,-467.11 332.08,-604.13 258.97,-616.86"/> -<polygon fill="black" stroke="black" points="258.81,-613.36 249.13,-617.69 259.39,-620.34 258.81,-613.36"/> -<text text-anchor="middle" x="324.22" y="-420.13" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg13->Loop11 --> -<g id="edge9" class="edge"> -<title>Phi_arg13->Loop11</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M291.81,-399.57C289.82,-399.57 287.82,-399.57 285.83,-399.57"/> -<polygon fill="black" stroke="black" points="285.94,-396.07 275.94,-399.57 285.94,-403.07 285.94,-396.07"/> -<text text-anchor="middle" x="289.56" y="-391.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35 --> -<g id="node20" class="node"> -<title>Sub35</title> -<ellipse fill="none" stroke="black" cx="439" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="439" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">-</text> -</g> -<!-- LT14 --> -<g id="node9" class="node"> -<title>LT14</title> -<ellipse fill="none" stroke="black" cx="235" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="235" y="-322.52" font-family="Times New Roman,serif" font-size="14.00"><</text> -</g> -<!-- LT14->Con_4 --> -<g id="edge13" class="edge"> -<title>LT14->Con_4</title> -<path fill="none" stroke="black" d="M225.54,-344.65C220.11,-354.85 213.81,-368.53 211,-381.57 200.86,-428.55 217.2,-483.7 229.46,-515.73"/> -<polygon fill="black" stroke="black" points="226.06,-516.65 233.02,-524.64 232.56,-514.06 226.06,-516.65"/> -<text text-anchor="middle" x="223.29" y="-346.8" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT14->Loop11 --> -<g id="edge12" class="edge"> -<title>LT14->Loop11</title> -<path fill="none" stroke="red" d="M237.97,-345.87C239.23,-353.24 240.74,-362.04 242.16,-370.32"/> -<polygon fill="red" stroke="red" points="238.67,-370.7 243.81,-379.97 245.57,-369.52 238.67,-370.7"/> -<text text-anchor="middle" x="235.72" y="-348.02" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- LT14->Phi_arg13 --> -<g id="edge14" class="edge"> -<title>LT14->Phi_arg13</title> -<path fill="none" stroke="black" d="M251.93,-341.73C264.83,-351.77 282.86,-365.79 297.78,-377.4"/> -<polygon fill="black" stroke="black" points="295.36,-379.95 305.4,-383.32 299.66,-374.42 295.36,-379.95"/> -<text text-anchor="middle" x="249.68" y="-343.88" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If16 --> -<g id="node10" class="node"> -<title>If16</title> -<polygon fill="yellow" stroke="none" points="202,-243.07 202,-269.57 278,-269.57 278,-243.07 202,-243.07"/> -<polygon fill="none" stroke="black" points="202,-243.07 202,-269.57 278,-269.57 278,-243.07 202,-243.07"/> -<text text-anchor="start" x="235.5" y="-251.27" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="202,-210.57 202,-243.07 278,-243.07 278,-210.57 202,-210.57"/> -<polygon fill="yellow" stroke="none" points="207,-215.57 207,-238.07 238.5,-238.07 238.5,-215.57 207,-215.57"/> -<polygon fill="none" stroke="black" points="207,-215.57 207,-238.07 238.5,-238.07 238.5,-215.57 207,-215.57"/> -<text text-anchor="start" x="210" y="-221.77" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="238.5,-215.57 238.5,-238.07 273,-238.07 273,-215.57 238.5,-215.57"/> -<polygon fill="none" stroke="black" points="238.5,-215.57 238.5,-238.07 273,-238.07 273,-215.57 238.5,-215.57"/> -<text text-anchor="start" x="241.5" y="-221.77" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If16->Loop11 --> -<g id="edge15" class="edge"> -<title>If16->Loop11</title> -<path fill="none" stroke="red" d="M267.48,-273.51C274.99,-284.3 282.12,-296.82 286,-309.57 290.66,-324.87 290.99,-330.36 286,-345.57 282.88,-355.08 277.32,-364.3 271.36,-372.3"/> -<polygon fill="red" stroke="red" points="268.78,-369.92 265.24,-379.91 274.24,-374.31 268.78,-369.92"/> -<text text-anchor="middle" x="265.23" y="-275.66" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If16->LT14 --> -<g id="edge16" class="edge"> -<title>If16->LT14</title> -<path fill="none" stroke="black" d="M238.11,-273.39C237.63,-281.55 237.12,-290.26 236.66,-298.21"/> -<polygon fill="black" stroke="black" points="233.17,-297.84 236.08,-308.03 240.16,-298.25 233.17,-297.84"/> -<text text-anchor="middle" x="235.86" y="-275.54" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Div21 --> -<g id="node11" class="node"> -<title>Div21</title> -<ellipse fill="none" stroke="black" cx="43" cy="-543.57" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-538.52" font-family="Times New Roman,serif" font-size="14.00">//</text> -</g> -<!-- Div21->Start2 --> -<g id="edge17" class="edge"> -<title>Div21->Start2</title> -<path fill="none" stroke="red" d="M63.39,-555.74C80.45,-565.09 105.82,-578.99 130.01,-592.25"/> -<polygon fill="red" stroke="red" points="128.14,-595.22 138.59,-596.96 131.5,-589.08 128.14,-595.22"/> -<text text-anchor="middle" x="65.64" y="-557.89" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Div21->Start2 --> -<g id="edge18" class="edge"> -<title>Div21->Start2:p2</title> -<path fill="none" stroke="black" d="M64.07,-555.23C68.91,-557.48 74.08,-559.72 79,-561.57 142.52,-585.33 224.7,-539.5 234.11,-594.15"/> -<polygon fill="black" stroke="black" points="230.62,-594.36 234.88,-604.06 237.59,-593.81 230.62,-594.36"/> -<text text-anchor="middle" x="66.32" y="-547.63" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_22 --> -<g id="node12" class="node"> -<title>Con_22</title> -<ellipse fill="none" stroke="black" cx="43" cy="-631.07" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-626.02" font-family="Times New Roman,serif" font-size="14.00">#3</text> -</g> -<!-- Div21->Con_22 --> -<g id="edge19" class="edge"> -<title>Div21->Con_22</title> -<path fill="none" stroke="black" d="M43,-561.87C43,-573.22 43,-588.35 43,-601.47"/> -<polygon fill="black" stroke="black" points="39.5,-601.28 43,-611.28 46.5,-601.28 39.5,-601.28"/> -<text text-anchor="middle" x="40.75" y="-564.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- EQ23 --> -<g id="node13" class="node"> -<title>EQ23</title> -<ellipse fill="none" stroke="black" cx="367" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="367" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">==</text> -</g> -<!-- EQ23->Loop11 --> -<g id="edge20" class="edge"> -<title>EQ23->Loop11</title> -<path fill="none" stroke="red" d="M347.18,-340.12C330.14,-350.07 305.08,-364.69 284.29,-376.81"/> -<polygon fill="red" stroke="red" points="282.66,-373.71 275.79,-381.77 286.19,-379.76 282.66,-373.71"/> -<text text-anchor="middle" x="349.43" y="-342.27" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- EQ23->Phi_arg13 --> -<g id="edge21" class="edge"> -<title>EQ23->Phi_arg13</title> -<path fill="none" stroke="black" d="M357.26,-344.8C352.4,-352.9 346.4,-362.9 340.89,-372.07"/> -<polygon fill="black" stroke="black" points="337.9,-370.26 335.76,-380.63 343.9,-373.86 337.9,-370.26"/> -<text text-anchor="middle" x="355.01" y="-346.95" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_24 --> -<g id="node14" class="node"> -<title>Con_24</title> -<ellipse fill="none" stroke="black" cx="403" cy="-399.57" rx="27" ry="18"/> -<text text-anchor="middle" x="403" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">#5</text> -</g> -<!-- EQ23->Con_24 --> -<g id="edge22" class="edge"> -<title>EQ23->Con_24</title> -<path fill="none" stroke="black" d="M375.35,-344.8C379.58,-353.02 384.81,-363.19 389.58,-372.47"/> -<polygon fill="black" stroke="black" points="386.32,-373.78 394,-381.07 392.54,-370.58 386.32,-373.78"/> -<text text-anchor="middle" x="373.1" y="-346.95" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If25 --> -<g id="node15" class="node"> -<title>If25</title> -<polygon fill="yellow" stroke="none" points="229,-140.07 229,-166.57 305,-166.57 305,-140.07 229,-140.07"/> -<polygon fill="none" stroke="black" points="229,-140.07 229,-166.57 305,-166.57 305,-140.07 229,-140.07"/> -<text text-anchor="start" x="262.5" y="-148.27" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="229,-107.57 229,-140.07 305,-140.07 305,-107.57 229,-107.57"/> -<polygon fill="yellow" stroke="none" points="234,-112.57 234,-135.07 265.5,-135.07 265.5,-112.57 234,-112.57"/> -<polygon fill="none" stroke="black" points="234,-112.57 234,-135.07 265.5,-135.07 265.5,-112.57 234,-112.57"/> -<text text-anchor="start" x="237" y="-118.77" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="265.5,-112.57 265.5,-135.07 300,-135.07 300,-112.57 265.5,-112.57"/> -<polygon fill="none" stroke="black" points="265.5,-112.57 265.5,-135.07 300,-135.07 300,-112.57 265.5,-112.57"/> -<text text-anchor="start" x="268.5" y="-118.77" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If25->If16 --> -<g id="edge23" class="edge"> -<title>If25->If16:p0</title> -<path fill="none" stroke="red" d="M238.48,-170.44C231.99,-180.18 226.3,-191.42 223.93,-203.17"/> -<polygon fill="red" stroke="red" points="220.45,-202.75 222.91,-213.06 227.42,-203.47 220.45,-202.75"/> -<text text-anchor="middle" x="236.23" y="-172.59" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If25->EQ23 --> -<g id="edge24" class="edge"> -<title>If25->EQ23</title> -<path fill="none" stroke="black" d="M295.16,-170.52C303.84,-181.5 312.95,-194.14 320,-206.57 336.96,-236.47 350.49,-273.71 358.6,-298.71"/> -<polygon fill="black" stroke="black" points="355.23,-299.66 361.58,-308.14 361.91,-297.55 355.23,-299.66"/> -<text text-anchor="middle" x="292.91" y="-172.67" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230->Store10 --> -<g id="edge26" class="edge"> -<title>Phi_230->Store10</title> -<path fill="none" stroke="blue" d="M113.7,-417.87C115.72,-425.33 118.14,-434.24 120.41,-442.6"/> -<polygon fill="blue" stroke="blue" points="116.96,-443.27 122.96,-452 123.72,-441.43 116.96,-443.27"/> -<text text-anchor="middle" x="111.45" y="-420.02" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230->Loop11 --> -<g id="edge25" class="edge"> -<title>Phi_230->Loop11</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M162.37,-399.57C177.71,-399.57 193.05,-399.57 208.39,-399.57"/> -<polygon fill="black" stroke="black" points="208.05,-403.07 218.05,-399.57 208.05,-396.07 208.05,-403.07"/> -<text text-anchor="middle" x="164.62" y="-391.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_233 --> -<g id="node19" class="node"> -<title>Phi_233</title> -<ellipse fill="lightyellow" stroke="black" cx="69" cy="-49.57" rx="52.89" ry="18"/> -<text text-anchor="middle" x="69" y="-44.52" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- Store31 --> -<g id="node17" class="node"> -<title>Store31</title> -<ellipse fill="none" stroke="black" cx="43" cy="-327.57" rx="27" ry="18"/> -<text text-anchor="middle" x="43" y="-322.52" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store31->new9 --> -<g id="edge30" class="edge"> -<title>Store31->new9</title> -<path fill="none" stroke="black" d="M30,-472.57C39.38,-497.6 63.9,-515.54 85.27,-526.98"/> -<polygon fill="black" stroke="black" points="83.57,-530.04 94.08,-531.4 86.71,-523.79 83.57,-530.04"/> -<text text-anchor="middle" x="27.75" y="-464.97" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store31->Loop11 --> -<g id="edge28" class="edge"> -<title>Store31->Loop11</title> -<path fill="none" stroke="red" d="M66.8,-336.73C101.75,-348.72 167.31,-371.22 208.98,-385.52"/> -<polygon fill="red" stroke="red" points="207.77,-388.8 218.36,-388.74 210.04,-382.18 207.77,-388.8"/> -<text text-anchor="middle" x="64.55" y="-338.88" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store31->Div21 --> -<g id="edge31" class="edge"> -<title>Store31->Div21</title> -<path fill="none" stroke="black" d="M36.55,-345.12C26.96,-372.45 11.89,-428.23 30,-470.57"/> -<path fill="none" stroke="black" d="M30,-472.57C34.94,-485.77 38.06,-501.11 40,-514.05"/> -<polygon fill="black" stroke="black" points="36.49,-514.19 41.27,-523.64 43.43,-513.27 36.49,-514.19"/> -<text text-anchor="middle" x="34.3" y="-347.27" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store31->Phi_230 --> -<g id="edge29" class="edge"> -<title>Store31->Phi_230</title> -<path fill="none" stroke="blue" d="M57,-343.41C65.39,-352.32 76.28,-363.86 85.92,-374.08"/> -<polygon fill="blue" stroke="blue" points="83.2,-376.3 92.6,-381.17 88.29,-371.5 83.2,-376.3"/> -<text text-anchor="middle" x="54.75" y="-345.56" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32->If25 --> -<g id="edge32" class="edge"> -<title>Region32->If25:p0</title> -<path fill="none" stroke="red" d="M249.89,-67.92C249.84,-77.07 249.79,-88.77 249.76,-100.25"/> -<polygon fill="red" stroke="red" points="246.26,-100.05 249.75,-110.05 253.26,-100.06 246.26,-100.05"/> -<text text-anchor="middle" x="247.64" y="-70.07" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32->If25 --> -<g id="edge33" class="edge"> -<title>Region32->If25:p1</title> -<path fill="none" stroke="red" d="M265.22,-67.95C271.77,-76.79 278.57,-88.22 281.39,-100.32"/> -<polygon fill="red" stroke="red" points="277.9,-100.55 282.57,-110.06 284.84,-99.72 277.9,-100.55"/> -<text text-anchor="middle" x="262.97" y="-70.1" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_233->Phi_230 --> -<g id="edge36" class="edge"> -<title>Phi_233->Phi_230</title> -<path fill="none" stroke="blue" d="M117.06,-66.52C146.85,-77.29 181.4,-91.65 192,-103.57 212.65,-126.78 191.37,-147.32 212,-170.57 238.69,-200.64 272.94,-172.95 295,-206.57 329.4,-258.98 315.45,-301.36 271,-345.57 244.42,-372 204.48,-385.25 170.9,-391.89"/> -<polygon fill="blue" stroke="blue" points="118.37,-63.28 107.78,-63.24 116.04,-69.87 118.37,-63.28"/> -<polygon fill="blue" stroke="blue" points="170.5,-388.41 161.28,-393.63 171.74,-395.3 170.5,-388.41"/> -<text text-anchor="middle" x="108.6" y="-64.88" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_233->Store31 --> -<g id="edge35" class="edge"> -<title>Phi_233->Store31</title> -<path fill="none" stroke="blue" d="M67.37,-67.83C63.02,-114.01 51.09,-240.72 45.7,-297.9"/> -<polygon fill="blue" stroke="blue" points="42.22,-297.52 44.77,-307.8 49.19,-298.17 42.22,-297.52"/> -<text text-anchor="middle" x="65.12" y="-69.98" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_233->Region32 --> -<g id="edge34" class="edge"> -<title>Phi_233->Region32</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M89.57,-32.51C103.01,-22.52 121.45,-10.85 140,-5.57 163.08,1.01 171.32,2.28 194,-5.57 205.22,-9.45 215.9,-16.6 224.86,-24.03"/> -<polygon fill="black" stroke="black" points="222.28,-26.42 232.09,-30.44 226.93,-21.19 222.28,-26.42"/> -<text text-anchor="middle" x="87.32" y="-24.91" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35->Loop11 --> -<g id="edge37" class="edge"> -<title>Sub35->Loop11</title> -<path fill="none" stroke="red" d="M417.91,-339.17C413.07,-341.42 407.9,-343.68 403,-345.57 354.16,-364.3 337.06,-362 284.88,-381.16"/> -<polygon fill="red" stroke="red" points="283.87,-377.8 275.75,-384.61 286.34,-384.35 283.87,-377.8"/> -<text text-anchor="middle" x="415.66" y="-341.32" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35->Phi_arg13 --> -<g id="edge38" class="edge"> -<title>Sub35->Phi_arg13</title> -<path fill="none" stroke="black" d="M409.92,-346.42C393.35,-356.59 372.61,-369.33 355.78,-379.67"/> -<polygon fill="black" stroke="black" points="411.68,-349.45 418.37,-341.23 408.02,-343.48 411.68,-349.45"/> -<polygon fill="black" stroke="black" points="354.36,-376.43 347.67,-384.65 358.02,-382.4 354.36,-376.43"/> -<text text-anchor="middle" x="419.66" y="-342.59" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_36 --> -<g id="node21" class="node"> -<title>Con_36</title> -<ellipse fill="none" stroke="black" cx="475" cy="-399.57" rx="27" ry="18"/> -<text text-anchor="middle" x="475" y="-394.52" font-family="Times New Roman,serif" font-size="14.00">#1</text> -</g> -<!-- Sub35->Con_36 --> -<g id="edge39" class="edge"> -<title>Sub35->Con_36</title> -<path fill="none" stroke="black" d="M447.35,-344.8C451.58,-353.02 456.81,-363.19 461.58,-372.47"/> -<polygon fill="black" stroke="black" points="458.32,-373.78 466,-381.07 464.54,-370.58 458.32,-373.78"/> -<text text-anchor="middle" x="445.1" y="-346.95" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return37->MemMerge --> -<g id="edge42" class="edge"> -<title>Return37->MemMerge</title> -<path fill="none" stroke="blue" d="M89,-241.07C86.12,-264.36 101.49,-285.96 117.39,-301.62"/> -<polygon fill="blue" stroke="blue" points="114.82,-304.01 124.55,-308.22 119.57,-298.86 114.82,-304.01"/> -<text text-anchor="middle" x="86.75" y="-233.47" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return37->new9 --> -<g id="edge41" class="edge"> -<title>Return37->new9</title> -<path fill="none" stroke="black" d="M137.23,-155.23C118.91,-173.78 93.19,-205.24 89,-239.07"/> -<path fill="none" stroke="black" d="M89,-241.07C83.27,-287.37 97.64,-302.79 79,-345.57 70.45,-365.19 54.61,-361.56 47,-381.57 41.31,-396.52 42.73,-402.15 47,-417.57 57.57,-455.72 83.23,-493.93 101.59,-517.87"/> -<polygon fill="black" stroke="black" points="98.84,-520.03 107.77,-525.73 104.34,-515.7 98.84,-520.03"/> -<text text-anchor="middle" x="134.98" y="-157.38" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return37->If16 --> -<g id="edge40" class="edge"> -<title>Return37->If16:p1</title> -<path fill="none" stroke="red" d="M177.62,-155.38C183.85,-160.32 190.67,-165.69 197,-170.57 219.31,-187.76 246.88,-183.75 254.01,-203.32"/> -<polygon fill="red" stroke="red" points="250.53,-203.72 255.52,-213.07 257.45,-202.65 250.53,-203.72"/> -<text text-anchor="middle" x="175.37" y="-157.53" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="1045" height="1366" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1045 1366" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,379)"><rect class="region-box" rx="8" width="951" height="780" fill="#f1f6fc"/></g><g class="region" transform="translate(243,862)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e1i0" d="M513,533 L513,593 L706,593 L706,603" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#1[0] → #11 · CTRL</title></path><path class="edge MEM" id="e1i1" d="M655,118 L655,128 L991,128 L991,336 L920,336 L920,593 L736,593 L736,603" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[1] → #6 · MEM</title></path><path class="edge MEM" id="e1i2" d="M817,533 L817,573 L766,573 L766,603" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[2] → #230 · MEM</title></path><path class="edge CTRL" id="e3i0" d="M643,1265 C643,1289 522.5,1292 522.5,1316" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #37 · CTRL</title></path><path class="edge CTRL" id="e9i0" d="M535,118 L535,148 L769,148 L769,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e10i0" d="M535,118 L535,242 L559,242 L559,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #5 · CTRL</title></path><path class="edge MEM" id="e10i1" d="M655,118 L655,128 L546,128 L546,232 L583,232 L583,270" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#10[1] → #6 · MEM</title></path><path class="edge DATA" id="e10i2" d="M769,222 L769,232 L607,232 L607,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge DATA" id="e10i3" d="M617,222 L617,252 L631,252 L631,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[3] → #4 · DATA</title></path><path class="edge CTRL" id="e11i1" d="M535,118 L535,148 L513,148 L513,477" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e11i2" d="M379,1097 L379,1107 L963,1107 L963,452 L543,452 L543,480" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[2] → #32 · CTRL</title></path><path class="edge DATA" id="e13i1" d="M775,118 L775,138 L524,138 L524,356 L645,356 L645,477" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[1] → #7 · DATA</title></path><path class="edge DATA" id="e13i2" d="M128,656 L128,666 L953,666 L953,460 L685,460 L685,480" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[2] → #35 · DATA</title></path><path class="edge CTRL" id="e14i0" d="M513,533 L513,593 L554,593 L554,603" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #11 · CTRL</title></path><path class="edge DATA" id="e14i1" d="M617,222 L617,252 L909,252 L909,583 L584,583 L584,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #4 · DATA</title></path><path class="edge DATA" id="e14i2" d="M665,533 L665,543 L614,543 L614,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge CTRL" id="e16i0" d="M513,533 L513,707" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #11 · CTRL</title></path><path class="edge DATA" id="e16i1" d="M584,659 L584,669 L593,669 L593,707" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #14 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M841,46 L891,46 L891,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #2 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M775,118 L775,138 L921,138 L921,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #7 · DATA</title></path><path class="edge DATA" id="e21i2" d="M961,118 L961,138 L951,138 L951,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[2] → #22 · DATA</title></path><path class="edge CTRL" id="e23i0" d="M513,533 L513,593 L250,593 L250,603" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[0] → #11 · CTRL</title></path><path class="edge DATA" id="e23i1" d="M665,533 L665,543 L280,543 L280,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[1] → #13 · DATA</title></path><path class="edge DATA" id="e23i2" d="M310,326 L310,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[2] → #24 · DATA</title></path><path class="edge CTRL" id="e25i0" d="M493,807 L493,837 L335,837 L335,896" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #8 · CTRL</title></path><path class="edge DATA" id="e25i1" d="M280,659 L280,847 L415,847 L415,896" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[1] → #23 · DATA</title></path><path class="edge CTRL" id="e31i0" d="M513,533 L513,593 L396,593 L396,603" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[0] → #11 · CTRL</title></path><path class="edge MEM" id="e31i1" d="M817,533 L817,573 L420,573 L420,603" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#31[1] → #230 · MEM</title></path><path class="edge DATA" id="e31i2" d="M769,222 L769,336 L887,336 L887,553 L444,553 L444,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[2] → #9 · DATA</title></path><path class="edge DATA" id="e31i3" d="M921,222 L921,242 L898,242 L898,563 L468,563 L468,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[3] → #21 · DATA</title></path><path class="edge CTRL" id="e32i1" d="M315,996 L315,1006 L379,1006 L379,1044" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#32[1] → #15 · CTRL</title></path><path class="edge CTRL" id="e32i2" d="M435,996 L435,1006 L409,1006 L409,1044" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#32[2] → #17 · CTRL</title></path><path class="edge CTRL" id="e35i0" d="M513,533 L513,593 L98,593 L98,603" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#35[0] → #11 · CTRL</title></path><path class="edge DATA" id="e35i1" d="M665,533 L665,543 L128,543 L128,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[1] → #13 · DATA</title></path><path class="edge DATA" id="e35i2" d="M158,326 L158,603" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[2] → #36 · DATA</title></path><path class="edge CTRL" id="e37i0" d="M613,807 L613,1212" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#37[0] → #12 · CTRL</title></path><path class="edge MEM" id="e37i1" d="M736,659 L736,1174 L643,1174 L643,1212" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#37[1] → #1 · MEM</title></path><path class="edge DATA" id="e37i2" d="M769,222 L769,232 L1002,232 L1002,1184 L673,1184 L673,1212" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[2] → #9 · DATA</title></path><path class="edge MEM" id="e230i1" d="M595,326 L595,346 L797,346 L797,477" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#230[1] → #10 · MEM</title></path><path class="edge MEM" id="e230i2" d="M531,1097 L531,1107 L943,1107 L943,468 L837,468 L837,480" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#230[2] → #233 · MEM</title></path><path class="edge MEM" id="e233i1" d="M432,659 L432,669 L411,669 L411,827 L511,827 L511,1044" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#233[1] → #31 · MEM</title></path><path class="edge MEM" id="e233i2" d="M817,533 L817,573 L502,573 L502,679 L422,679 L422,817 L551,817 L551,1044" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#233[2] → #230 · MEM</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(676,609)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 MemMerge +Type not computed + +[0] → #11 CTRL +[1] → #6 MEM +[2] → #230 MEM</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(475,24)" style="opacity: 1;"><path class="box" d="M0,0H360V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="180" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="180"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(486.5,1316)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #37 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(557,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(475,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(595,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEM</title></g><g class="node" id="n7" data-id="7" transform="translate(715,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #7/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n8" data-id="8" transform="translate(433,757)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #16 +Type not computed + +[0] → #16 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(709,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n10" data-id="10" transform="translate(535,276)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 .f = +Type not computed + +[0] → #5 CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n11" data-id="11" transform="translate(453,483)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 Loop +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #32 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(553,757)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #12/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 False +Projection 1 of #16 +Type not computed + +[0] → #16 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(605,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 φ_arg +Type not computed + +[0] → #11 ASSOC +[1] → #7 DATA +[2] → #35 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #11</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n14" data-id="14" transform="translate(524,609)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 < +Type not computed + +[0] → #11 CTRL +[1] → #4 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(255,946)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #15/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 True +Projection 0 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n16" data-id="16" transform="translate(433,713)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#16 If +Type not computed + +[0] → #11 CTRL +[1] → #14 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n17" data-id="17" transform="translate(375,946)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #17/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 False +Projection 1 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n21" data-id="21" transform="translate(861,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>//</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 // +Type not computed + +[0] → #2 CTRL +[1] → #7 DATA +[2] → #22 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n22" data-id="22" transform="translate(901,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 #3 +Type not computed + +</title></g><g class="node" id="n23" data-id="23" transform="translate(220,609)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 == +Type not computed + +[0] → #11 CTRL +[1] → #13 DATA +[2] → #24 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n24" data-id="24" transform="translate(250,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 #5 +Type not computed + +</title></g><g class="node" id="n25" data-id="25" transform="translate(255,902)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#25 If +Type not computed + +[0] → #8 CTRL +[1] → #23 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n31" data-id="31" transform="translate(372,609)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #31</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#31 .f = +Type not computed + +[0] → #11 CTRL +[1] → #230 MEM +[2] → #9 DATA +[3] → #21 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n32" data-id="32" transform="translate(319,1050)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #32</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#32 Region +Type not computed + +[0] → — DATA +[1] → #15 CTRL +[2] → #17 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n35" data-id="35" transform="translate(68,609)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #35</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#35 - +Type not computed + +[0] → #11 CTRL +[1] → #13 DATA +[2] → #36 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n36" data-id="36" transform="translate(98,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #36</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#36 #1 +Type not computed + +</title></g><g class="node" id="n37" data-id="37" transform="translate(583,1218)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #37</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#37 Return +Type not computed + +[0] → #12 CTRL +[1] → #1 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n230" data-id="230" transform="translate(757,483)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #230</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#230 MemPhi_2 +Type not computed + +[0] → #11 ASSOC +[1] → #10 MEM +[2] → #233 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #11</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n233" data-id="233" transform="translate(471,1050)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #233</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#233 MemPhi_2 +Type not computed + +[0] → #32 ASSOC +[1] → #31 MEM +[2] → #230 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #32</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,379)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #11</tspan></text><title>Loop · 16 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #11"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(243,862)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><title>If · 5 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #25"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph6.json b/chapter11/docs/graph6.json new file mode 100644 index 00000000..1c08947a --- /dev/null +++ b/chapter11/docs/graph6.json @@ -0,0 +1,42 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph6.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 37, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, + {"id": 7, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 2}}, + {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": {"par": 16, "idx": 0}}, + {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 6, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 32, "role": "CTRL", "label": null}], "proj": null}, + {"id": 12, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}], "proj": {"par": 16, "idx": 1}}, + {"id": 13, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 35, "role": "DATA", "label": null}], "proj": null}, + {"id": 14, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 0}}, + {"id": 16, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 25, "role": "CTRL", "label": null}], "proj": {"par": 25, "idx": 1}}, + {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "DATA", "label": null}, {"idx": 2, "def": 22, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 23, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "#5", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 25, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 23, "role": "DATA", "label": null}], "proj": null}, + {"id": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}, {"idx": 1, "def": 230, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}, {"idx": 3, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 32, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 15, "role": "CTRL", "label": null}, {"idx": 2, "def": 17, "role": "CTRL", "label": null}], "proj": null}, + {"id": 35, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 32, "role": "CTRL", "label": null}, {"idx": 1, "def": 13, "role": "DATA", "label": null}, {"idx": 2, "def": 36, "role": "DATA", "label": null}], "proj": null}, + {"id": 36, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}, {"idx": 1, "def": 1, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 230, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 11, "role": "ASSOC", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 233, "role": "MEM", "label": null}], "proj": null}, + {"id": 233, "label": "MemPhi_2", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 32, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} + ], + "groups": [ + {"id": 11, "par": 0, "nodes": [8, 11, 12, 13, 14, 16, 23, 230]}, + {"id": 25, "par": 11, "nodes": [15, 17, 25, 31, 32, 35, 233]} + ] +} diff --git a/chapter11/docs/graph6.svg b/chapter11/docs/graph6.svg index 8b8bb190..8862f25c 100644 --- a/chapter11/docs/graph6.svg +++ b/chapter11/docs/graph6.svg @@ -1,471 +1,187 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="384pt" height="889pt" - viewBox="0.00 0.00 384.00 889.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 885)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-885 380,-885 380,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-873 368,-873 368,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="172.38,-834.5 172.38,-861 277.62,-861 277.62,-834.5 172.38,-834.5"/> -<polygon fill="none" stroke="black" points="172.38,-834.5 172.38,-861 277.62,-861 277.62,-834.5 172.38,-834.5"/> -<text text-anchor="start" x="212.25" y="-842.7" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="172.38,-802 172.38,-834.5 277.62,-834.5 277.62,-802 172.38,-802"/> -<polygon fill="yellow" stroke="none" points="177.38,-807 177.38,-829.5 208.12,-829.5 208.12,-807 177.38,-807"/> -<polygon fill="none" stroke="black" points="177.38,-807 177.38,-829.5 208.12,-829.5 208.12,-807 177.38,-807"/> -<text text-anchor="start" x="180.38" y="-813.2" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -<polygon fill="none" stroke="black" points="208.12,-807 208.12,-829.5 249.38,-829.5 249.38,-807 208.12,-807"/> -<text text-anchor="start" x="211.12" y="-813.2" font-family="Times New Roman,serif" font-size="14.00">$mem</text> -<polygon fill="none" stroke="black" points="249.38,-807 249.38,-829.5 272.62,-829.5 272.62,-807 249.38,-807"/> -<text text-anchor="start" x="252.38" y="-813.2" font-family="Times New Roman,serif" font-size="14.00">arg</text> -</g> -<!-- MemMerge --> -<g id="node2" class="node"> -<title>MemMerge</title> -<polygon fill="none" stroke="black" points="333,-371 251,-371 251,-335 333,-335 333,-371"/> -<text text-anchor="middle" x="292" y="-347.95" font-family="Times New Roman,serif" font-size="14.00">MemMerge</text> -</g> -<!-- MemMerge->Start2 --> -<g id="edge43" class="edge"> -<title>MemMerge->Start2:p1</title> -<path fill="none" stroke="blue" d="M307.5,-371.34C315.32,-381.11 324.15,-393.96 329,-407 361.8,-495.22 367.07,-526.05 347,-618 331.99,-686.78 323.62,-705.97 281,-762 265.35,-782.58 238.46,-778 230.83,-794.94"/> -<polygon fill="blue" stroke="blue" points="227.43,-794.04 229.03,-804.51 234.31,-795.33 227.43,-794.04"/> -<text text-anchor="middle" x="305.25" y="-373.49" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- If16 --> -<g id="node10" class="node"> -<title>If16</title> -<polygon fill="yellow" stroke="none" points="236,-443.5 236,-470 312,-470 312,-443.5 236,-443.5"/> -<polygon fill="none" stroke="black" points="236,-443.5 236,-470 312,-470 312,-443.5 236,-443.5"/> -<text text-anchor="start" x="269.5" y="-451.7" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="236,-411 236,-443.5 312,-443.5 312,-411 236,-411"/> -<polygon fill="yellow" stroke="none" points="241,-416 241,-438.5 272.5,-438.5 272.5,-416 241,-416"/> -<polygon fill="none" stroke="black" points="241,-416 241,-438.5 272.5,-438.5 272.5,-416 241,-416"/> -<text text-anchor="start" x="244" y="-422.2" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="272.5,-416 272.5,-438.5 307,-438.5 307,-416 272.5,-416"/> -<polygon fill="none" stroke="black" points="272.5,-416 272.5,-438.5 307,-438.5 307,-416 272.5,-416"/> -<text text-anchor="start" x="275.5" y="-422.2" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- MemMerge->If16 --> -<g id="edge45" class="edge"> -<title>MemMerge->If16:p1</title> -<path fill="none" stroke="green" d="M291.02,-371.35C290.56,-380.5 290.08,-392.19 289.86,-403.68"/> -<polygon fill="green" stroke="green" points="286.37,-403.45 289.77,-413.49 293.36,-403.52 286.37,-403.45"/> -<text text-anchor="middle" x="288.77" y="-373.5" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_230 --> -<g id="node16" class="node"> -<title>Phi_230</title> -<ellipse fill="lightyellow" stroke="black" cx="109" cy="-600" rx="52.89" ry="18"/> -<text text-anchor="middle" x="109" y="-594.95" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- MemMerge->Phi_230 --> -<g id="edge44" class="edge"> -<title>MemMerge->Phi_230</title> -<path fill="none" stroke="blue" d="M262.46,-371.47C248.23,-380.82 231.57,-393.24 219,-407 195.6,-432.6 205.05,-451.1 179,-474 134.6,-513.03 57.61,-467.89 57,-527"/> -<text text-anchor="middle" x="260.21" y="-373.62" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="260,-196 206,-196 206,-160 260,-160 260,-196"/> -<text text-anchor="middle" x="233" y="-172.95" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return37 --> -<g id="node22" class="node"> -<title>Return37</title> -<polygon fill="yellow" stroke="black" points="260,-283.5 206,-283.5 206,-247.5 260,-247.5 260,-283.5"/> -<text text-anchor="middle" x="233" y="-260.45" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return37 --> -<g id="edge1" class="edge"> -<title>Stop3->Return37</title> -<path fill="none" stroke="red" d="M233,-196.3C233,-207.66 233,-222.78 233,-235.9"/> -<polygon fill="red" stroke="red" points="229.5,-235.71 233,-245.71 236.5,-235.71 229.5,-235.71"/> -<text text-anchor="middle" x="230.75" y="-198.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="239" cy="-744" rx="27" ry="18"/> -<text text-anchor="middle" x="239" y="-738.95" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- new9 --> -<g id="node5" class="node"> -<title>new9</title> -<ellipse fill="none" stroke="black" cx="140" cy="-744" rx="33.95" ry="18"/> -<text text-anchor="middle" x="140" y="-738.95" font-family="Times New Roman,serif" font-size="14.00">new S</text> -</g> -<!-- new9->Start2 --> -<g id="edge2" class="edge"> -<title>new9->Start2:p0</title> -<path fill="none" stroke="green" d="M161.46,-758.23C173.32,-767.03 186.56,-779.76 191.11,-795.03"/> -<polygon fill="green" stroke="green" points="187.59,-795.13 192.53,-804.5 194.51,-794.1 187.59,-795.13"/> -<text text-anchor="middle" x="163.71" y="-760.38" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store10 --> -<g id="node6" class="node"> -<title>Store10</title> -<ellipse fill="none" stroke="black" cx="166" cy="-672" rx="27" ry="18"/> -<text text-anchor="middle" x="166" y="-666.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store10->Start2 --> -<g id="edge3" class="edge"> -<title>Store10->Start2:p0</title> -<path fill="none" stroke="red" d="M172.35,-689.96C175.97,-700.25 180.31,-713.73 183,-726 189.8,-757.02 192.21,-767.77 192.66,-794.78"/> -<polygon fill="red" stroke="red" points="189.16,-794.51 192.74,-804.49 196.16,-794.46 189.16,-794.51"/> -<text text-anchor="middle" x="170.1" y="-692.11" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store10->Con_4 --> -<g id="edge6" class="edge"> -<title>Store10->Con_4</title> -<path fill="none" stroke="black" d="M180.77,-687.17C190.8,-696.78 204.26,-709.69 215.72,-720.68"/> -<polygon fill="black" stroke="black" points="213.27,-723.17 222.91,-727.57 218.11,-718.12 213.27,-723.17"/> -<text text-anchor="middle" x="178.52" y="-689.32" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store10->new9 --> -<g id="edge5" class="edge"> -<title>Store10->new9</title> -<path fill="none" stroke="black" d="M159.71,-689.95C156.86,-697.6 153.43,-706.84 150.24,-715.44"/> -<polygon fill="black" stroke="black" points="146.96,-714.2 146.76,-724.79 153.53,-716.64 146.96,-714.2"/> -<text text-anchor="middle" x="157.46" y="-692.1" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Loop11 --> -<g id="node7" class="node"> -<title>Loop11</title> -<polygon fill="yellow" stroke="black" points="338,-618 284,-618 284,-582 338,-582 338,-618"/> -<text text-anchor="middle" x="311" y="-594.95" font-family="Times New Roman,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop11->Start2 --> -<g id="edge7" class="edge"> -<title>Loop11->Start2:p0</title> -<path fill="none" stroke="red" d="M311.62,-618.44C311.85,-650.26 308.1,-718.44 275,-762 252.66,-791.4 204.87,-770.45 194.68,-794.8"/> -<polygon fill="red" stroke="red" points="191.26,-794.06 193.01,-804.51 198.16,-795.25 191.26,-794.06"/> -<text text-anchor="middle" x="309.37" y="-620.59" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32 --> -<g id="node18" class="node"> -<title>Region32</title> -<polygon fill="yellow" stroke="black" points="215.5,-124 160.5,-124 160.5,-88 215.5,-88 215.5,-124"/> -<text text-anchor="middle" x="188" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">Region</text> -</g> -<!-- Loop11->Region32 --> -<g id="edge8" class="edge"> -<title>Loop11->Region32</title> -<path fill="none" stroke="red" d="M317.97,-581.54C334.1,-538.52 370.49,-424.48 342,-335 324.98,-281.54 311.59,-268.53 269,-232 241.84,-208.71 217.32,-225.45 197,-196 184.99,-178.59 183.21,-154.52 184.18,-135.8"/> -<polygon fill="red" stroke="red" points="187.66,-136.16 185,-125.91 180.68,-135.58 187.66,-136.16"/> -<text text-anchor="middle" x="315.72" y="-573.94" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_arg13 --> -<g id="node8" class="node"> -<title>Phi_arg13</title> -<ellipse fill="lightyellow" stroke="black" cx="213" cy="-600" rx="32.93" ry="18"/> -<text text-anchor="middle" x="213" y="-594.95" font-family="Times New Roman,serif" font-size="14.00">φ_arg</text> -</g> -<!-- Phi_arg13->Start2 --> -<g id="edge10" class="edge"> -<title>Phi_arg13->Start2:p2</title> -<path fill="none" stroke="black" d="M224.02,-617.05C239.03,-639.99 265.16,-684.02 275,-726 278.65,-741.58 277.45,-746.19 275,-762 272.54,-777.84 265.38,-783.26 262.36,-794.66"/> -<polygon fill="black" stroke="black" points="258.9,-794.15 261.18,-804.5 265.85,-794.99 258.9,-794.15"/> -<text text-anchor="middle" x="221.77" y="-619.2" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_arg13->Loop11 --> -<g id="edge9" class="edge"> -<title>Phi_arg13->Loop11</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M246.3,-600C254.97,-600 263.64,-600 272.31,-600"/> -<polygon fill="black" stroke="black" points="272.19,-603.5 282.19,-600 272.19,-596.5 272.19,-603.5"/> -<text text-anchor="middle" x="248.55" y="-592.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35 --> -<g id="node20" class="node"> -<title>Sub35</title> -<ellipse fill="none" stroke="black" cx="188" cy="-34" rx="27" ry="18"/> -<text text-anchor="middle" x="188" y="-28.95" font-family="Times New Roman,serif" font-size="14.00">-</text> -</g> -<!-- LT14 --> -<g id="node9" class="node"> -<title>LT14</title> -<ellipse fill="none" stroke="black" cx="265" cy="-528" rx="27" ry="18"/> -<text text-anchor="middle" x="265" y="-522.95" font-family="Times New Roman,serif" font-size="14.00"><</text> -</g> -<!-- LT14->Con_4 --> -<g id="edge13" class="edge"> -<title>LT14->Con_4</title> -<path fill="none" stroke="black" d="M263.12,-546.4C261.17,-564.35 257.99,-593.15 255,-618 251.03,-651.04 246.13,-688.95 242.8,-714.27"/> -<polygon fill="black" stroke="black" points="239.34,-713.75 241.51,-724.12 246.28,-714.66 239.34,-713.75"/> -<text text-anchor="middle" x="260.87" y="-548.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- LT14->Loop11 --> -<g id="edge12" class="edge"> -<title>LT14->Loop11</title> -<path fill="none" stroke="red" d="M275.44,-544.88C280.73,-552.94 287.31,-562.95 293.36,-572.16"/> -<polygon fill="red" stroke="red" points="290.39,-574.01 298.81,-580.44 296.24,-570.16 290.39,-574.01"/> -<text text-anchor="middle" x="277.69" y="-547.03" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- LT14->Phi_arg13 --> -<g id="edge14" class="edge"> -<title>LT14->Phi_arg13</title> -<path fill="none" stroke="black" d="M253.46,-544.54C247.02,-553.2 238.85,-564.21 231.53,-574.05"/> -<polygon fill="black" stroke="black" points="228.92,-571.69 225.77,-581.81 234.54,-575.87 228.92,-571.69"/> -<text text-anchor="middle" x="255.71" y="-546.69" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If16->Loop11 --> -<g id="edge15" class="edge"> -<title>If16->Loop11</title> -<path fill="none" stroke="red" d="M288.71,-473.68C293.31,-484.96 297.98,-497.84 301,-510 305.94,-529.86 308.44,-552.83 309.71,-570.45"/> -<polygon fill="red" stroke="red" points="306.2,-570.42 310.31,-580.19 313.19,-569.99 306.2,-570.42"/> -<text text-anchor="middle" x="286.46" y="-475.83" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If16->LT14 --> -<g id="edge16" class="edge"> -<title>If16->LT14</title> -<path fill="none" stroke="black" d="M270.6,-473.82C269.74,-481.99 268.82,-490.69 267.98,-498.65"/> -<polygon fill="black" stroke="black" points="264.52,-498.15 266.95,-508.47 271.48,-498.89 264.52,-498.15"/> -<text text-anchor="middle" x="268.35" y="-475.97" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Div21 --> -<g id="node11" class="node"> -<title>Div21</title> -<ellipse fill="none" stroke="black" cx="61" cy="-744" rx="27" ry="18"/> -<text text-anchor="middle" x="61" y="-738.95" font-family="Times New Roman,serif" font-size="14.00">//</text> -</g> -<!-- Div21->Start2 --> -<g id="edge17" class="edge"> -<title>Div21->Start2:p0</title> -<path fill="none" stroke="red" d="M73.85,-760.18C91.84,-779.79 126.72,-812.07 165.38,-817.47"/> -<polygon fill="red" stroke="red" points="164.64,-820.93 174.87,-818.14 165.14,-813.95 164.64,-820.93"/> -<text text-anchor="middle" x="71.6" y="-762.33" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Div21->Start2 --> -<g id="edge18" class="edge"> -<title>Div21->Start2:p2</title> -<path fill="none" stroke="black" d="M82.05,-755.71C86.89,-757.96 92.07,-760.19 97,-762 163.97,-786.57 250.88,-736.57 260.18,-794.78"/> -<polygon fill="black" stroke="black" points="256.67,-794.77 260.89,-804.49 263.65,-794.26 256.67,-794.77"/> -<text text-anchor="middle" x="84.3" y="-757.86" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Con_22 --> -<g id="node12" class="node"> -<title>Con_22</title> -<ellipse fill="none" stroke="black" cx="61" cy="-831.5" rx="27" ry="18"/> -<text text-anchor="middle" x="61" y="-826.45" font-family="Times New Roman,serif" font-size="14.00">#3</text> -</g> -<!-- Div21->Con_22 --> -<g id="edge19" class="edge"> -<title>Div21->Con_22</title> -<path fill="none" stroke="black" d="M61,-762.3C61,-773.66 61,-788.78 61,-801.9"/> -<polygon fill="black" stroke="black" points="57.5,-801.71 61,-811.71 64.5,-801.71 57.5,-801.71"/> -<text text-anchor="middle" x="58.75" y="-764.45" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- EQ23 --> -<g id="node13" class="node"> -<title>EQ23</title> -<ellipse fill="none" stroke="black" cx="165" cy="-353" rx="27" ry="18"/> -<text text-anchor="middle" x="165" y="-347.95" font-family="Times New Roman,serif" font-size="14.00">==</text> -</g> -<!-- EQ23->Phi_arg13 --> -<g id="edge21" class="edge"> -<title>EQ23->Phi_arg13</title> -<path fill="none" stroke="black" d="M169.9,-371.1C172.77,-381.44 176.34,-394.92 179,-407 191.71,-464.72 202.9,-533.02 208.73,-570.62"/> -<polygon fill="black" stroke="black" points="205.22,-570.85 210.2,-580.2 212.14,-569.78 205.22,-570.85"/> -<text text-anchor="middle" x="167.65" y="-373.25" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- EQ23->If16 --> -<g id="edge20" class="edge"> -<title>EQ23->If16:p0</title> -<path fill="none" stroke="red" d="M178.1,-368.82C192.8,-385.21 216.42,-410.75 230.4,-421.83"/> -<polygon fill="red" stroke="red" points="228.25,-424.63 238.68,-426.51 231.7,-418.54 228.25,-424.63"/> -<text text-anchor="middle" x="180.35" y="-370.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_24 --> -<g id="node14" class="node"> -<title>Con_24</title> -<ellipse fill="none" stroke="black" cx="143" cy="-440.5" rx="27" ry="18"/> -<text text-anchor="middle" x="143" y="-435.45" font-family="Times New Roman,serif" font-size="14.00">#5</text> -</g> -<!-- EQ23->Con_24 --> -<g id="edge22" class="edge"> -<title>EQ23->Con_24</title> -<path fill="none" stroke="black" d="M160.65,-370.89C157.69,-382.41 153.69,-397.94 150.25,-411.31"/> -<polygon fill="black" stroke="black" points="146.89,-410.33 147.79,-420.88 153.67,-412.07 146.89,-410.33"/> -<text text-anchor="middle" x="158.4" y="-373.04" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- If25 --> -<g id="node15" class="node"> -<title>If25</title> -<polygon fill="yellow" stroke="none" points="104,-268.5 104,-295 180,-295 180,-268.5 104,-268.5"/> -<polygon fill="none" stroke="black" points="104,-268.5 104,-295 180,-295 180,-268.5 104,-268.5"/> -<text text-anchor="start" x="137.5" y="-276.7" font-family="Times New Roman,serif" font-size="14.00">If</text> -<polygon fill="none" stroke="black" points="104,-236 104,-268.5 180,-268.5 180,-236 104,-236"/> -<polygon fill="yellow" stroke="none" points="109,-241 109,-263.5 140.5,-263.5 140.5,-241 109,-241"/> -<polygon fill="none" stroke="black" points="109,-241 109,-263.5 140.5,-263.5 140.5,-241 109,-241"/> -<text text-anchor="start" x="112" y="-247.2" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="140.5,-241 140.5,-263.5 175,-263.5 175,-241 140.5,-241"/> -<polygon fill="none" stroke="black" points="140.5,-241 140.5,-263.5 175,-263.5 175,-241 140.5,-241"/> -<text text-anchor="start" x="143.5" y="-247.2" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- If25->If16 --> -<g id="edge23" class="edge"> -<title>If25->If16:p0</title> -<path fill="none" stroke="red" d="M170.91,-298.68C180.72,-309.96 191.57,-322.85 201,-335 203.66,-338.43 237.81,-384.19 251.31,-405.07"/> -<polygon fill="red" stroke="red" points="248.15,-406.58 256.02,-413.67 254.29,-403.22 248.15,-406.58"/> -<text text-anchor="middle" x="168.66" y="-300.83" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- If25->EQ23 --> -<g id="edge24" class="edge"> -<title>If25->EQ23</title> -<path fill="none" stroke="black" d="M150.7,-298.82C152.92,-307.08 155.29,-315.9 157.45,-323.93"/> -<polygon fill="black" stroke="black" points="154.05,-324.76 160.03,-333.51 160.81,-322.94 154.05,-324.76"/> -<text text-anchor="middle" x="148.45" y="-300.97" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230->Store10 --> -<g id="edge26" class="edge"> -<title>Phi_230->Store10</title> -<path fill="none" stroke="blue" d="M122.51,-617.59C129.69,-626.41 138.66,-637.42 146.57,-647.14"/> -<polygon fill="blue" stroke="blue" points="143.77,-649.24 152.8,-654.79 149.2,-644.82 143.77,-649.24"/> -<text text-anchor="middle" x="120.26" y="-619.74" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_230->Loop11 --> -<g id="edge25" class="edge"> -<title>Phi_230->Loop11</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M133.84,-583.77C146.98,-576.14 163.74,-567.89 180,-564 215.01,-555.63 226.74,-552.95 261,-564 268.52,-566.43 275.87,-570.45 282.52,-574.95"/> -<polygon fill="black" stroke="black" points="280.35,-577.71 290.47,-580.85 284.52,-572.08 280.35,-577.71"/> -<text text-anchor="middle" x="131.59" y="-576.17" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Phi_233 --> -<g id="node19" class="node"> -<title>Phi_233</title> -<ellipse fill="lightyellow" stroke="black" cx="69" cy="-106" rx="52.89" ry="18"/> -<text text-anchor="middle" x="69" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">MemPhi_2</text> -</g> -<!-- Store31 --> -<g id="node17" class="node"> -<title>Store31</title> -<ellipse fill="none" stroke="black" cx="58" cy="-178" rx="27" ry="18"/> -<text text-anchor="middle" x="58" y="-172.95" font-family="Times New Roman,serif" font-size="14.00">.f =</text> -</g> -<!-- Store31->new9 --> -<g id="edge30" class="edge"> -<title>Store31->new9</title> -<path fill="none" stroke="black" d="M57,-354C19.45,-421.68 37,-449.6 37,-527 37,-527 37,-527 37,-601 37,-651.78 80.7,-696.66 111.17,-721.77"/> -<polygon fill="black" stroke="black" points="108.95,-724.48 118.96,-727.98 113.32,-719.01 108.95,-724.48"/> -<path fill="none" stroke="black" d="M57,-266.5C57.21,-285.5 66.47,-335.53 57,-352"/> -<path fill="none" stroke="black" d="M57.56,-196.36C57.19,-213.63 56.74,-240.9 57,-264.5"/> -<text text-anchor="middle" x="54.75" y="-346.4" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Store31->Div21 --> -<g id="edge31" class="edge"> -<title>Store31->Div21</title> -<path fill="none" stroke="black" d="M51.23,-195.87C39.58,-226.46 17,-293.35 17,-352 17,-352 17,-352 17,-601 17,-641.11 18.86,-652.1 32,-690 35.19,-699.2 39.88,-708.69 44.56,-717.06"/> -<polygon fill="black" stroke="black" points="41.52,-718.8 49.61,-725.64 47.56,-715.25 41.52,-718.8"/> -<text text-anchor="middle" x="48.98" y="-198.02" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> -</g> -<!-- Store31->If25 --> -<g id="edge28" class="edge"> -<title>Store31->If25:p0</title> -<path fill="none" stroke="red" d="M61.66,-195.99C66.57,-214.42 77.07,-242.26 96.81,-250.12"/> -<polygon fill="red" stroke="red" points="96.03,-253.53 106.51,-251.97 97.35,-246.66 96.03,-253.53"/> -<text text-anchor="middle" x="59.41" y="-198.14" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Store31->Phi_230 --> -<g id="edge29" class="edge"> -<title>Store31->Phi_230</title> -<path fill="none" stroke="blue" d="M57,-529C56.5,-546.83 67.47,-563.07 79.46,-575.42"/> -<polygon fill="blue" stroke="blue" points="77.03,-577.93 86.7,-582.27 81.85,-572.85 77.03,-577.93"/> -<path fill="none" stroke="blue" d="M57,-266.5C69.32,-381.62 60.25,-411.27 57,-527"/> -<text text-anchor="middle" x="54.75" y="-521.4" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32->If25 --> -<g id="edge32" class="edge"> -<title>Region32->If25:p0</title> -<path fill="none" stroke="red" d="M173.65,-124.25C156.55,-146.45 129.75,-187.13 125.37,-228.59"/> -<polygon fill="red" stroke="red" points="121.87,-228.31 124.83,-238.49 128.86,-228.69 121.87,-228.31"/> -<text text-anchor="middle" x="171.4" y="-126.4" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Region32->If25 --> -<g id="edge33" class="edge"> -<title>Region32->If25:p1</title> -<path fill="none" stroke="red" d="M181.44,-124.35C173.32,-147.27 160.3,-189.33 158.08,-228.71"/> -<polygon fill="red" stroke="red" points="154.59,-228.39 157.79,-238.49 161.58,-228.59 154.59,-228.39"/> -<text text-anchor="middle" x="179.19" y="-126.5" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_233->Phi_230 --> -<g id="edge36" class="edge"> -<title>Phi_233->Phi_230</title> -<path fill="none" stroke="blue" d="M84.51,-133.96C88.4,-142.07 92.02,-151.16 94,-160 97.5,-175.61 98.33,-180.6 94,-196 88.92,-214.05 77.08,-213.95 72,-232 55.48,-290.7 59.98,-384.37 92,-546 93.66,-554.38 96.2,-563.28 98.81,-571.36"/> -<polygon fill="blue" stroke="blue" points="87.75,-132.6 80.06,-125.32 81.53,-135.81 87.75,-132.6"/> -<polygon fill="blue" stroke="blue" points="95.44,-572.31 101.98,-580.64 102.06,-570.05 95.44,-572.31"/> -<text text-anchor="middle" x="77.12" y="-126.12" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Phi_233->Store31 --> -<g id="edge35" class="edge"> -<title>Phi_233->Store31</title> -<path fill="none" stroke="blue" d="M66.28,-124.3C65.12,-131.68 63.74,-140.48 62.44,-148.75"/> -<polygon fill="blue" stroke="blue" points="59.02,-147.98 60.92,-158.4 65.93,-149.07 59.02,-147.98"/> -<text text-anchor="middle" x="64.03" y="-126.45" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Phi_233->Region32 --> -<g id="edge34" class="edge"> -<title>Phi_233->Region32</title> -<path fill="none" stroke="black" stroke-dasharray="1,5" d="M121.99,-106C130.94,-106 139.88,-106 148.82,-106"/> -<polygon fill="black" stroke="black" points="148.64,-109.5 158.64,-106 148.64,-102.5 148.64,-109.5"/> -<text text-anchor="middle" x="124.24" y="-98.4" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Sub35->Phi_arg13 --> -<g id="edge38" class="edge"> -<title>Sub35->Phi_arg13</title> -<path fill="none" stroke="black" d="M170.02,-59.56C163.96,-68.33 157.37,-78.41 152,-88 143.43,-103.32 90.69,-214.84 87,-232 73.48,-294.79 101.52,-461.34 107,-474 125.1,-515.81 162.03,-554.22 187.15,-577.13"/> -<polygon fill="black" stroke="black" points="172.77,-61.74 175.68,-51.55 167.05,-57.7 172.77,-61.74"/> -<polygon fill="black" stroke="black" points="184.57,-579.51 194.36,-583.56 189.22,-574.29 184.57,-579.51"/> -<text text-anchor="middle" x="174.31" y="-52.47" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Sub35->Region32 --> -<g id="edge37" class="edge"> -<title>Sub35->Region32</title> -<path fill="none" stroke="red" d="M188,-52.3C188,-59.59 188,-68.27 188,-76.46"/> -<polygon fill="red" stroke="red" points="184.5,-76.38 188,-86.38 191.5,-76.38 184.5,-76.38"/> -<text text-anchor="middle" x="185.75" y="-54.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Con_36 --> -<g id="node21" class="node"> -<title>Con_36</title> -<ellipse fill="none" stroke="black" cx="261" cy="-106" rx="27" ry="18"/> -<text text-anchor="middle" x="261" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">#1</text> -</g> -<!-- Sub35->Con_36 --> -<g id="edge39" class="edge"> -<title>Sub35->Con_36</title> -<path fill="none" stroke="black" d="M202.77,-49.17C212.8,-58.78 226.26,-71.69 237.72,-82.68"/> -<polygon fill="black" stroke="black" points="235.27,-85.17 244.91,-89.57 240.11,-80.12 235.27,-85.17"/> -<text text-anchor="middle" x="200.52" y="-51.32" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return37->MemMerge --> -<g id="edge42" class="edge"> -<title>Return37->MemMerge</title> -<path fill="none" stroke="blue" d="M244.94,-283.8C253.18,-295.74 264.29,-311.84 273.64,-325.4"/> -<polygon fill="blue" stroke="blue" points="270.66,-327.24 279.22,-333.48 276.42,-323.26 270.66,-327.24"/> -<text text-anchor="middle" x="242.69" y="-285.95" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Return37->new9 --> -<g id="edge41" class="edge"> -<title>Return37->new9</title> -<path fill="none" stroke="black" d="M216.48,-283.78C210.69,-289.16 203.9,-294.79 197,-299 140.21,-333.67 89.27,-293.82 57,-352"/> -<text text-anchor="middle" x="214.23" y="-285.93" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Return37->If16 --> -<g id="edge40" class="edge"> -<title>Return37->If16:p1</title> -<path fill="none" stroke="red" d="M230.82,-283.79C228.88,-305.37 228.21,-342.88 242,-371 252.72,-392.86 279.35,-388.61 287.4,-404.08"/> -<polygon fill="red" stroke="red" points="283.91,-404.48 289.43,-413.52 290.75,-403.01 283.91,-404.48"/> -<text text-anchor="middle" x="228.57" y="-285.94" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="728" height="1808" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 728 1808" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,391)"><rect class="region-box" rx="8" width="642" height="1106" fill="#f1f6fc"/></g><g class="region" transform="translate(90,980)"><rect class="region-box" rx="8" width="336" height="460" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e1i0" d="M282,819 L282,829 L58,829 L58,1522 L99,1522 L99,1550" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#1[0] → #12 · CTRL</title></path><path class="edge MEM" id="e1i1" d="M348,118 L348,128 L684,128 L684,1522 L129,1522 L129,1550" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[1] → #6 · MEM</title></path><path class="edge MEM" id="e1i2" d="M486,545 L486,575 L80,575 L80,935 L79,935 L79,1512 L159,1512 L159,1550" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#1[2] → #230 · MEM</title></path><path class="edge CTRL" id="e3i0" d="M88,1707 C88,1731 364,1734 364,1758" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #37 · CTRL</title></path><path class="edge CTRL" id="e9i0" d="M228,118 L228,148 L462,148 L462,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#9[0] → #5 · CTRL</title></path><path class="edge CTRL" id="e10i0" d="M228,118 L228,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#10[0] → #5 · CTRL</title></path><path class="edge MEM" id="e10i1" d="M348,118 L348,128 L239,128 L239,232 L252,232 L252,270" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#10[1] → #6 · MEM</title></path><path class="edge DATA" id="e10i2" d="M462,222 L462,242 L276,242 L276,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[2] → #9 · DATA</title></path><path class="edge DATA" id="e10i3" d="M310,222 L310,252 L300,252 L300,270" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#10[3] → #4 · DATA</title></path><path class="edge CTRL" id="e11i1" d="M228,118 L228,148 L182,148 L182,489" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[1] → #5 · CTRL</title></path><path class="edge CTRL" id="e11i2" d="M184,1321 L184,1331 L654,1331 L654,464 L212,464 L212,492" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#11[2] → #32 · CTRL</title></path><path class="edge DATA" id="e13i1" d="M468,118 L468,138 L193,138 L193,376 L314,376 L314,489" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[1] → #7 · DATA</title></path><path class="edge DATA" id="e13i2" d="M214,1425 L214,1435 L644,1435 L644,472 L354,472 L354,492" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#13[2] → #35 · DATA</title></path><path class="edge CTRL" id="e14i0" d="M182,545 L182,605 L223,605 L223,615" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#14[0] → #11 · CTRL</title></path><path class="edge DATA" id="e14i1" d="M310,222 L310,252 L334,252 L334,356 L556,356 L556,585 L253,585 L253,615" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[1] → #4 · DATA</title></path><path class="edge DATA" id="e14i2" d="M334,545 L334,595 L283,595 L283,615" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#14[2] → #13 · DATA</title></path><path class="edge CTRL" id="e16i0" d="M182,545 L182,719" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#16[0] → #11 · CTRL</title></path><path class="edge DATA" id="e16i1" d="M253,671 L253,681 L262,681 L262,719" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#16[1] → #14 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M228,118 L228,148 L584,148 L584,166" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #5 · CTRL</title></path><path class="edge DATA" id="e21i1" d="M468,118 L468,138 L614,138 L614,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[1] → #7 · DATA</title></path><path class="edge DATA" id="e21i2" d="M644,118 L644,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[2] → #22 · DATA</title></path><path class="edge CTRL" id="e23i0" d="M162,819 L162,849 L203,849 L203,869" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#23[0] → #8 · CTRL</title></path><path class="edge DATA" id="e23i1" d="M334,545 L334,595 L369,595 L369,849 L233,849 L233,869" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[1] → #13 · DATA</title></path><path class="edge DATA" id="e23i2" d="M557,326 L557,336 L578,336 L578,565 L567,565 L567,859 L263,859 L263,869" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#23[2] → #24 · DATA</title></path><path class="edge CTRL" id="e25i0" d="M162,819 L162,935 L204,935 L204,1014" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#25[0] → #8 · CTRL</title></path><path class="edge DATA" id="e25i1" d="M233,925 L233,935 L284,935 L284,1014" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#25[1] → #23 · DATA</title></path><path class="edge CTRL" id="e31i0" d="M184,1114 L184,1134 L249,1134 L249,1164" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#31[0] → #15 · CTRL</title></path><path class="edge MEM" id="e31i1" d="M486,545 L486,575 L578,575 L578,935 L380,935 L380,1134 L273,1134 L273,1164" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#31[1] → #230 · MEM</title></path><path class="edge DATA" id="e31i2" d="M462,222 L462,242 L627,242 L627,336 L589,336 L589,945 L391,945 L391,1144 L297,1144 L297,1164" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[2] → #9 · DATA</title></path><path class="edge DATA" id="e31i3" d="M614,222 L614,232 L638,232 L638,346 L600,346 L600,955 L402,955 L402,1154 L321,1154 L321,1164" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#31[3] → #21 · DATA</title></path><path class="edge CTRL" id="e32i1" d="M184,1114 L184,1268" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#32[1] → #15 · CTRL</title></path><path class="edge CTRL" id="e32i2" d="M304,1114 L304,1124 L214,1124 L214,1268" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#32[2] → #17 · CTRL</title></path><path class="edge CTRL" id="e35i0" d="M184,1324 L184,1372" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#35[0] → #32 · CTRL</title></path><path class="edge DATA" id="e35i1" d="M334,545 L334,595 L91,595 L91,935 L102,935 L102,1354 L214,1354 L214,1372" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[1] → #13 · DATA</title></path><path class="edge DATA" id="e35i2" d="M405,326 L405,346 L567,346 L567,555 L358,555 L358,839 L113,839 L113,1344 L244,1344 L244,1372" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#35[2] → #36 · DATA</title></path><path class="edge CTRL" id="e37i0" d="M282,819 L282,829 L58,829 L58,1654" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#37[0] → #12 · CTRL</title></path><path class="edge MEM" id="e37i1" d="M129,1606 L129,1616 L88,1616 L88,1654" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#37[1] → #1 · MEM</title></path><path class="edge DATA" id="e37i2" d="M462,222 L462,242 L695,242 L695,1626 L118,1626 L118,1654" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#37[2] → #9 · DATA</title></path><path class="edge MEM" id="e230i1" d="M264,326 L264,366 L466,366 L466,489" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#230[1] → #10 · MEM</title></path><path class="edge MEM" id="e230i2" d="M336,1321 L336,1331 L634,1331 L634,480 L506,480 L506,492" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#230[2] → #233 · MEM</title></path><path class="edge MEM" id="e233i1" d="M285,1220 L285,1230 L316,1230 L316,1268" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#233[1] → #31 · MEM</title></path><path class="edge MEM" id="e233i2" d="M486,545 L486,575 L611,575 L611,965 L413,965 L413,1230 L356,1230 L356,1268" stroke="#2867b2" marker-start="url(#arrow-MEM)" style="opacity: 1;"><title>#233[2] → #230 · MEM</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(69,1556)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemMerge</tspan><tspan class="node-id">  #1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 MemMerge +Type not computed + +[0] → #12 CTRL +[1] → #6 MEM +[2] → #230 MEM</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n2" data-id="2" transform="translate(168,24)" style="opacity: 1;"><path class="box" d="M0,0H360V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="180" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="180"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(328,1758)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #37 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(250,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(168,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #5/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(288,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$mem</tspan><tspan class="node-id">  #6/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $mem +Projection 1 of #2 +Type not computed + +[0] → #2 MEM</title></g><g class="node" id="n7" data-id="7" transform="translate(408,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>arg</tspan><tspan class="node-id">  #7/2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#7 arg +Projection 2 of #2 +Type not computed + +[0] → #2 DATA</title></g><g class="node" id="n8" data-id="8" transform="translate(102,769)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #8/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 True +Projection 0 of #16 +Type not computed + +[0] → #16 CTRL</title></g><g class="node" id="n9" data-id="9" transform="translate(402,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>new S</tspan><tspan class="node-id">  #9</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#9 new S +Type not computed + +[0] → #5 CTRL</title><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><text class="slot" x="60" y="-10" text-anchor="middle">0</text></g><g class="node" id="n10" data-id="10" transform="translate(204,276)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #10</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#10 .f = +Type not computed + +[0] → #5 CTRL +[1] → #6 MEM +[2] → #9 DATA +[3] → #4 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n11" data-id="11" transform="translate(122,495)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #11</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#11 Loop +Type not computed + +[0] → — DATA +[1] → #5 CTRL +[2] → #32 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n12" data-id="12" transform="translate(222,769)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #12/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#12 False +Projection 1 of #16 +Type not computed + +[0] → #16 CTRL</title></g><g class="node" id="n13" data-id="13" transform="translate(274,495)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>φ_arg</tspan><tspan class="node-id">  #13</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#13 φ_arg +Type not computed + +[0] → #11 ASSOC +[1] → #7 DATA +[2] → #35 DATA</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #11</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n14" data-id="14" transform="translate(193,621)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan><</tspan><tspan class="node-id">  #14</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#14 < +Type not computed + +[0] → #11 CTRL +[1] → #4 DATA +[2] → #13 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n15" data-id="15" transform="translate(124,1064)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #15/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#15 True +Projection 0 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n16" data-id="16" transform="translate(102,725)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #16</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#16 If +Type not computed + +[0] → #11 CTRL +[1] → #14 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n17" data-id="17" transform="translate(244,1064)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #17/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#17 False +Projection 1 of #25 +Type not computed + +[0] → #25 CTRL</title></g><g class="node" id="n21" data-id="21" transform="translate(554,172)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>//</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 // +Type not computed + +[0] → #5 CTRL +[1] → #7 DATA +[2] → #22 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n22" data-id="22" transform="translate(584,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#3</tspan><tspan class="node-id">  #22</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#22 #3 +Type not computed + +</title></g><g class="node" id="n23" data-id="23" transform="translate(173,875)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>==</tspan><tspan class="node-id">  #23</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#23 == +Type not computed + +[0] → #8 CTRL +[1] → #13 DATA +[2] → #24 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n24" data-id="24" transform="translate(497,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#5</tspan><tspan class="node-id">  #24</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#24 #5 +Type not computed + +</title></g><g class="node" id="n25" data-id="25" transform="translate(124,1020)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#25 If +Type not computed + +[0] → #8 CTRL +[1] → #23 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n31" data-id="31" transform="translate(225,1170)" style="opacity: 1;"><path class="box" d="M10,0H110L120,10V34L110,44H10L0,34V10Z" fill="#dcecff"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>.f =</tspan><tspan class="node-id">  #31</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#31 .f = +Type not computed + +[0] → #15 CTRL +[1] → #230 MEM +[2] → #9 DATA +[3] → #21 DATA</title><circle class="port" cx="24" cy="-3" r="3" fill="#536477"/><circle class="port" cx="48" cy="-3" r="3" fill="#536477"/><circle class="port" cx="72" cy="-3" r="3" fill="#536477"/><circle class="port" cx="96" cy="-3" r="3" fill="#536477"/><text class="slot" x="24" y="-10" text-anchor="middle">0</text><text class="slot" x="48" y="-10" text-anchor="middle">1</text><text class="slot" x="72" y="-10" text-anchor="middle">2</text><text class="slot" x="96" y="-10" text-anchor="middle">3</text></g><g class="node" id="n32" data-id="32" transform="translate(124,1274)" style="opacity: 1;"><path class="box" d="M12,0H108L120,44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Region</tspan><tspan class="node-id">  #32</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#32 Region +Type not computed + +[0] → — DATA +[1] → #15 CTRL +[2] → #17 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n35" data-id="35" transform="translate(154,1378)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>-</tspan><tspan class="node-id">  #35</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#35 - +Type not computed + +[0] → #32 CTRL +[1] → #13 DATA +[2] → #36 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n36" data-id="36" transform="translate(345,276)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#1</tspan><tspan class="node-id">  #36</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#36 #1 +Type not computed + +</title></g><g class="node" id="n37" data-id="37" transform="translate(28,1660)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #37</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#37 Return +Type not computed + +[0] → #12 CTRL +[1] → #1 MEM +[2] → #9 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n230" data-id="230" transform="translate(426,495)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #230</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#230 MemPhi_2 +Type not computed + +[0] → #11 ASSOC +[1] → #10 MEM +[2] → #233 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #11</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g><g class="node" id="n233" data-id="233" transform="translate(276,1274)" style="opacity: 1;"><path class="box" d="M12,0H108L120,22L108,44H12L0,22Z" fill="#f5e4fa"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>MemPhi_2</tspan><tspan class="node-id">  #233</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#233 MemPhi_2 +Type not computed + +[0] → #32 ASSOC +[1] → #31 MEM +[2] → #230 MEM</title><circle class="port" cx="-3" cy="22" r="3" fill="#536477"/><circle class="port" cx="40" cy="-3" r="3" fill="#536477"/><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><path class="reg" fill="none" stroke="#b63838" d="M-3,22H-18m4,-3l-4,3l4,3"><title>[0] → #32</title></path><text class="slot" x="-10" y="15" text-anchor="middle">0</text><text class="slot" x="40" y="-10" text-anchor="middle">1</text><text class="slot" x="80" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,391)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #11</tspan></text><title>Loop · 15 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #11"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g><g class="region-head" transform="translate(90,980)"><text class="label" x="26" y="17"><tspan>If</tspan><tspan class="node-id">  #25</tspan></text><title>If · 7 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #25"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph7.json b/chapter11/docs/graph7.json new file mode 100644 index 00000000..c1c86b07 --- /dev/null +++ b/chapter11/docs/graph7.json @@ -0,0 +1,16 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph7.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 8, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 8, "role": "CTRL", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [8]} + ] +} diff --git a/chapter11/docs/graph7.svg b/chapter11/docs/graph7.svg index 854660ec..e83b8d54 100644 --- a/chapter11/docs/graph7.svg +++ b/chapter11/docs/graph7.svg @@ -1,54 +1,78 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 2.43.0 (0) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="184pt" height="176pt" - viewBox="0.00 0.00 184.00 176.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 172)"> -<title>chapter11</title> -<polygon fill="white" stroke="transparent" points="-4,4 -4,-172 180,-172 180,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-160 168,-160 168,-8 8,-8"/> -</g> -<!-- Start2 --> -<g id="node1" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="transparent" points="24,-123 24,-148 74,-148 74,-123 24,-123"/> -<polygon fill="none" stroke="black" points="24,-123 24,-148 74,-148 74,-123 24,-123"/> -<text text-anchor="start" x="30.5" y="-131.8" font-family="Times,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="24,-92 24,-123 74,-123 74,-92 24,-92"/> -<polygon fill="yellow" stroke="transparent" points="29,-97 29,-118 69,-118 69,-97 29,-97"/> -<polygon fill="none" stroke="black" points="29,-97 29,-118 69,-118 69,-97 29,-97"/> -<text text-anchor="start" x="32" y="-103.8" font-family="Times,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Con_4 --> -<g id="node2" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="133" cy="-34" rx="27" ry="18"/> -<text text-anchor="middle" x="133" y="-30.3" font-family="Times,serif" font-size="14.00">#0</text> -</g> -<!-- Loop8 --> -<g id="node3" class="node"> -<title>Loop8</title> -<polygon fill="yellow" stroke="black" points="70,-52 16,-52 16,-16 70,-16 70,-52"/> -<text text-anchor="middle" x="43" y="-30.3" font-family="Times,serif" font-size="14.00">Loop</text> -</g> -<!-- Loop8->Start2 --> -<g id="edge1" class="edge"> -<title>Loop8->Start2:p0</title> -<path fill="none" stroke="red" d="M45.58,-52.05C46.84,-61.49 48.2,-73.71 48.75,-85.65"/> -<polygon fill="red" stroke="red" points="45.26,-86.09 49,-96 52.25,-85.92 45.26,-86.09"/> -<text text-anchor="middle" x="42.58" y="-54.65" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Loop8->Loop8 --> -<g id="edge2" class="edge"> -<title>Loop8->Loop8</title> -<path fill="none" stroke="red" d="M70.24,-17.89C80.02,-17.54 88,-22.91 88,-34 88,-40.93 84.88,-45.62 80.16,-48.09"/> -<polygon fill="red" stroke="red" points="79.34,-44.68 70.24,-50.11 80.74,-51.54 79.34,-44.68"/> -<text text-anchor="middle" x="73.24" y="-11.49" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="364" height="325" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 364 325" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(164,171)"><rect class="region-box" rx="8" width="176" height="130" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e8i1" d="M236,118 L236,223" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[1] → #1 · CTRL</title></path><path class="edge CTRL" id="e8i2" d="M236,276 L236,286 L328,286 L328,214 L266,214 L266,226" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[2] → #8 · CTRL</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(176,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(176,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n4" data-id="4" transform="translate(24,49)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n8" data-id="8" transform="translate(176,229)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 Loop +Type not computed + +[0] → — DATA +[1] → #1 CTRL +[2] → #8 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(164,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><title>Loop · 1 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter11/docs/graph8.json b/chapter11/docs/graph8.json new file mode 100644 index 00000000..ab2ef65c --- /dev/null +++ b/chapter11/docs/graph8.json @@ -0,0 +1,21 @@ +{ + "ver": 1, + "comp": "chapter11/docs/graph8.svg", + "step": 1, + "roots": [], + "scope": 0, + "nodes": [ + {"id": 1, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}], "proj": {"par": 18, "idx": 0}}, + {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, + {"id": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, + {"id": 5, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}], "proj": {"par": 18, "idx": 1}}, + {"id": 6, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, + {"id": 8, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, + {"id": 18, "label": "Never", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 0, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + {"id": 8, "par": 0, "nodes": [1, 5, 8, 18]} + ] +} diff --git a/chapter11/docs/graph8.svg b/chapter11/docs/graph8.svg index a89eeeb5..4db46240 100644 --- a/chapter11/docs/graph8.svg +++ b/chapter11/docs/graph8.svg @@ -1,115 +1,98 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" - "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> -<!-- Generated by graphviz version 12.2.0 (20241103.1931) - --> -<!-- Title: chapter11 Pages: 1 --> -<svg width="166pt" height="426pt" - viewBox="0.00 0.00 166.00 426.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> -<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 422)"> -<title>chapter11</title> -<polygon fill="white" stroke="none" points="-4,4 -4,-422 162,-422 162,4 -4,4"/> -<g id="clust1" class="cluster"> -<title>cluster_Nodes</title> -<polygon fill="none" stroke="black" points="8,-8 8,-410 150,-410 150,-8 8,-8"/> -</g> -<!-- Never18 --> -<g id="node1" class="node"> -<title>Never18</title> -<polygon fill="yellow" stroke="none" points="24,-196.5 24,-223 100,-223 100,-196.5 24,-196.5"/> -<polygon fill="none" stroke="black" points="24,-196.5 24,-223 100,-223 100,-196.5 24,-196.5"/> -<text text-anchor="start" x="45.5" y="-204.7" font-family="Times New Roman,serif" font-size="14.00">Never</text> -<polygon fill="none" stroke="black" points="24,-164 24,-196.5 100,-196.5 100,-164 24,-164"/> -<polygon fill="yellow" stroke="none" points="29,-169 29,-191.5 60.5,-191.5 60.5,-169 29,-169"/> -<polygon fill="none" stroke="black" points="29,-169 29,-191.5 60.5,-191.5 60.5,-169 29,-169"/> -<text text-anchor="start" x="32" y="-175.2" font-family="Times New Roman,serif" font-size="14.00">True</text> -<polygon fill="yellow" stroke="none" points="60.5,-169 60.5,-191.5 95,-191.5 95,-169 60.5,-169"/> -<polygon fill="none" stroke="black" points="60.5,-169 60.5,-191.5 95,-191.5 95,-169 60.5,-169"/> -<text text-anchor="start" x="63.5" y="-175.2" font-family="Times New Roman,serif" font-size="14.00">False</text> -</g> -<!-- Con_4 --> -<g id="node4" class="node"> -<title>Con_4</title> -<ellipse fill="none" stroke="black" cx="115" cy="-281" rx="27" ry="18"/> -<text text-anchor="middle" x="115" y="-275.95" font-family="Times New Roman,serif" font-size="14.00">#0</text> -</g> -<!-- Never18->Con_4 --> -<g id="edge2" class="edge"> -<title>Never18->Con_4</title> -<path fill="none" stroke="black" d="M82.04,-226.82C87.68,-235.93 93.75,-245.71 99.11,-254.37"/> -<polygon fill="black" stroke="black" points="95.99,-255.97 104.23,-262.63 101.94,-252.28 95.99,-255.97"/> -<text text-anchor="middle" x="79.79" y="-228.97" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -<!-- Loop8 --> -<g id="node6" class="node"> -<title>Loop8</title> -<polygon fill="yellow" stroke="black" points="70,-299 16,-299 16,-263 70,-263 70,-299"/> -<text text-anchor="middle" x="43" y="-275.95" font-family="Times New Roman,serif" font-size="14.00">Loop</text> -</g> -<!-- Never18->Loop8 --> -<g id="edge1" class="edge"> -<title>Never18->Loop8</title> -<path fill="none" stroke="red" d="M54.82,-226.82C52.98,-235.08 51.02,-243.9 49.24,-251.93"/> -<polygon fill="red" stroke="red" points="45.87,-250.97 47.11,-261.49 52.7,-252.49 45.87,-250.97"/> -<text text-anchor="middle" x="52.57" y="-228.97" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Start2 --> -<g id="node2" class="node"> -<title>Start2</title> -<polygon fill="yellow" stroke="none" points="23.62,-371.5 23.62,-398 64.38,-398 64.38,-371.5 23.62,-371.5"/> -<polygon fill="none" stroke="black" points="23.62,-371.5 23.62,-398 64.38,-398 64.38,-371.5 23.62,-371.5"/> -<text text-anchor="start" x="31.25" y="-379.7" font-family="Times New Roman,serif" font-size="14.00">Start</text> -<polygon fill="none" stroke="black" points="23.62,-339 23.62,-371.5 64.38,-371.5 64.38,-339 23.62,-339"/> -<polygon fill="yellow" stroke="none" points="28.62,-344 28.62,-366.5 59.38,-366.5 59.38,-344 28.62,-344"/> -<polygon fill="none" stroke="black" points="28.62,-344 28.62,-366.5 59.38,-366.5 59.38,-344 28.62,-344"/> -<text text-anchor="start" x="31.62" y="-350.2" font-family="Times New Roman,serif" font-size="14.00">$ctrl</text> -</g> -<!-- Stop3 --> -<g id="node3" class="node"> -<title>Stop3</title> -<polygon fill="yellow" stroke="black" points="107,-52 53,-52 53,-16 107,-16 107,-52"/> -<text text-anchor="middle" x="80" y="-28.95" font-family="Times New Roman,serif" font-size="14.00">Stop</text> -</g> -<!-- Return21 --> -<g id="node5" class="node"> -<title>Return21</title> -<polygon fill="yellow" stroke="black" points="107,-124 53,-124 53,-88 107,-88 107,-124"/> -<text text-anchor="middle" x="80" y="-100.95" font-family="Times New Roman,serif" font-size="14.00">Return</text> -</g> -<!-- Stop3->Return21 --> -<g id="edge3" class="edge"> -<title>Stop3->Return21</title> -<path fill="none" stroke="red" d="M80,-52.3C80,-59.59 80,-68.27 80,-76.46"/> -<polygon fill="red" stroke="red" points="76.5,-76.38 80,-86.38 83.5,-76.38 76.5,-76.38"/> -<text text-anchor="middle" x="77.75" y="-54.45" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return21->Never18 --> -<g id="edge4" class="edge"> -<title>Return21->Never18:p0</title> -<path fill="none" stroke="red" d="M63.41,-124.45C56.41,-133.22 49.19,-144.55 46.19,-156.68"/> -<polygon fill="red" stroke="red" points="42.73,-156.14 44.94,-166.5 49.68,-157.02 42.73,-156.14"/> -<text text-anchor="middle" x="61.16" y="-126.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> -</g> -<!-- Return21->Con_4 --> -<g id="edge5" class="edge"> -<title>Return21->Con_4</title> -<path fill="none" stroke="black" d="M96.04,-124.15C104.01,-133.88 112.83,-146.73 117,-160 126.51,-190.23 124.01,-226.9 120.42,-251.69"/> -<polygon fill="black" stroke="black" points="117,-250.9 118.86,-261.33 123.91,-252.02 117,-250.9"/> -<text text-anchor="middle" x="93.79" y="-126.3" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Loop8->Never18 --> -<g id="edge7" class="edge"> -<title>Loop8->Never18:p1</title> -<path fill="none" stroke="red" d="M66.89,-262.62C77.59,-253.37 89.1,-241.02 95,-227 100.86,-213.08 109.7,-194.71 106.13,-185.7"/> -<polygon fill="red" stroke="red" points="107.8,-182.63 97.33,-180.97 104.48,-188.79 107.8,-182.63"/> -<text text-anchor="middle" x="64.64" y="-255.02" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> -</g> -<!-- Loop8->Start2 --> -<g id="edge6" class="edge"> -<title>Loop8->Start2:p0</title> -<path fill="none" stroke="red" d="M43.44,-299.35C43.64,-308.51 43.85,-320.2 43.95,-331.69"/> -<polygon fill="red" stroke="red" points="40.45,-331.5 43.99,-341.49 47.45,-331.47 40.45,-331.5"/> -<text text-anchor="middle" x="41.19" y="-301.5" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> -</g> -</g> -</svg> +<svg aria-label="Compiler graph" width="431" height="676" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 431 676" style="font-family: sans-serif;"><style> + html, body { height:100%; margin:0; font-family:sans-serif; } + .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } + .source { padding:8px; border-bottom:1px solid #ccc; } + #program { width:min(600px,80vw); vertical-align:middle; } + #status { margin-top:4px; } + #graph { min-height:0; overflow:hidden; position:relative; background:#fafbfc; } + #elk { width:100%; height:100%; } + #graph svg { display:block; } + .tools { display:flex; flex-wrap:wrap; align-items:center; gap:14px; margin-top:8px; font-size:12px; } + .hint { color:#616c78; } + .ctrl { color:#b63838; } .mem { color:#2867b2; } .data { color:#536477; } + .edge { fill:none; stroke-width:1.5; } + .edge.CTRL { stroke-width:2; } + .edge.ASSOC { stroke-dasharray:4 4; } + .edge.PARSER { stroke-dasharray:5 4; } + .parser rect { fill:#f6f0ff; stroke:#7956a5; stroke-width:1.5; stroke-dasharray:5 4; } + .edge.selected { stroke-width:3.5; } + .edge.bundle { stroke-width:4; } + .edge.bundle.selected { stroke-width:6; } + .edge-hit { fill:none; stroke:transparent; stroke-width:12; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; } + .edge-jump { fill:transparent; pointer-events:all; cursor:pointer; } + .node { cursor:pointer; } + .box { stroke:#758191; stroke-width:1; } + .node.held .box { stroke-dasharray:5 3; } + .node.near .box { stroke:#c18221; stroke-width:2; } + .node.focus .box { stroke:#9c4900; stroke-width:3; } + .node.selected .box { stroke:#1569b9; stroke-width:3; } + .node.folded .box { stroke-width:4; } + .node.folding .box { fill:#f4ccd7; } + .fold-tag { font-size:9px; font-weight:700; fill:#963751; } + .peep-area { fill:#fff3d9; fill-opacity:.8; stroke:#c18221; stroke-width:2; pointer-events:none; } + .node.peep-edit .box { stroke:#9c4900; stroke-width:3; } + .node.error .box { stroke:#b42318; stroke-width:4; } + #event.error { color:#b42318; font-weight:600; white-space:pre-wrap; overflow-wrap:anywhere; } + .peep-ghosts { pointer-events:none; } + .region-box { stroke:#9da9b8; stroke-width:1.5; } + .fold-btn { cursor:pointer; } + .fold-btn rect { fill:white; stroke:#596674; } + .fold-btn text { font-size:14px; fill:#152330; } + .fold-btn:focus rect { stroke:#1569b9; stroke-width:2; } + .shortcut { cursor:pointer; } + .shortcut path { fill:none; stroke-width:1.5; } + .shortcut rect { fill:#fff8ec; stroke:#b63838; stroke-dasharray:3 2; } + .shortcut text { font-size:11px; fill:#783030; } + .shortcut.selected rect, .shortcut:focus rect { stroke-width:2.5; } + .label { font-size:12px; fill:#152330; font-weight:600; } + .node-id { font-size:10px; fill:#596674; font-weight:400; } + .type { font-size:11px; fill:#455768; } + .port { stroke:#536477; stroke-width:1; } + .row { stroke:#b6afcf; stroke-width:1; } + .bind { font-size:12px; fill:#152330; } + .slot { font-size:10px; fill:#364352; paint-order:stroke; stroke:#fafbfc; stroke-width:3; } + #detail { position:absolute; top:8px; right:8px; margin:0; padding:12px; max-width:320px; + max-height:45%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; + background:#fffffff2; border:1px solid #bac5d0; border-radius:4px; font-size:12px; } + .controls { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; padding:6px; } + .button { color:white; background:black; font-size:20px; min-width:30px; } + .button:disabled { background:grey; } + .count { font-size:20px; min-width:35px; text-align:center; } + #N { width:6ch; } + #scrub { width:clamp(120px,35vw,600px); } + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="313" height="298" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M126,575 C126,599 215.5,602 215.5,626" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #21 · CTRL</title></path><path class="edge CTRL" id="e8i1" d="M116,118 L116,233" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[1] → #6 · CTRL</title></path><path class="edge CTRL" id="e8i2" d="M216,434 L216,444 L325,444 L325,224 L146,224 L146,236" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#8[2] → #5 · CTRL</title></path><path class="edge CTRL" id="e18i0" d="M116,289 L116,337" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#18[0] → #8 · CTRL</title></path><path class="edge DATA" id="e18i1" d="M347,118 L347,128 L302,128 L302,299 L196,299 L196,337" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#18[1] → #4 · DATA</title></path><path class="edge CTRL" id="e21i0" d="M96,437 L96,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#21[0] → #1 · CTRL</title></path><path class="edge DATA" id="e21i2" d="M347,118 L347,484 L156,484 L156,522" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#21[2] → #4 · DATA</title></path></g><g class="edge-hits"/><g class="parser" style="opacity: 1;"/><g class="nodes"><g class="node" id="n1" data-id="1" transform="translate(36,387)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>True</tspan><tspan class="node-id">  #1/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#1 True +Projection 0 of #18 +Type not computed + +[0] → #18 CTRL</title></g><g class="node" id="n2" data-id="2" transform="translate(56,24)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Start</tspan><tspan class="node-id">  #2</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#2 Start +Type not computed + +</title></g><g class="node" id="n3" data-id="3" transform="translate(179.5,626)" style="opacity: 1;"><path class="box" d="M0,0H72V26H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="36" y="17"><tspan>Stop</tspan><tspan class="node-id">  #3</tspan></text><text class="type" text-anchor="middle" y="35" x="36"/><title>#3 Stop +Type not computed + +[0] → #21 CTRL</title><circle class="port" cx="36" cy="0" r="3" fill="#536477"/><text class="slot" x="36" y="-7" text-anchor="middle">0</text></g><g class="node" id="n4" data-id="4" transform="translate(287,68)" style="opacity: 1;"><path class="box" d="M14,0H106Q120,0 120,14V30Q120,44 106,44H14Q0,44 0,30V14Q0,0 14,0Z" fill="#edf3f7"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>#0</tspan><tspan class="node-id">  #4</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#4 #0 +Type not computed + +</title></g><g class="node" id="n5" data-id="5" transform="translate(156,387)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>False</tspan><tspan class="node-id">  #5/1</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#5 False +Projection 1 of #18 +Type not computed + +[0] → #18 CTRL</title></g><g class="node" id="n6" data-id="6" transform="translate(56,68)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>$ctrl</tspan><tspan class="node-id">  #6/0</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#6 $ctrl +Projection 0 of #2 +Type not computed + +[0] → #2 CTRL</title></g><g class="node" id="n8" data-id="8" transform="translate(56,239)" style="opacity: 1;"><path class="box" d="M20,0H100Q120,0 120,20V24Q120,44 100,44H20Q0,44 0,24V20Q0,0 20,0Z" fill="#ffe0ab"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#8 Loop +Type not computed + +[0] → — DATA +[1] → #6 CTRL +[2] → #5 CTRL</title><circle class="port" cx="30" cy="-3" r="3" fill="white"/><circle class="port" cx="60" cy="-3" r="3" fill="#536477"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g><g class="node" id="n18" data-id="18" transform="translate(36,343)" style="opacity: 1;"><path class="box" d="M0,0H240V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="120" y="18"><tspan>Never</tspan><tspan class="node-id">  #18</tspan></text><text class="type" text-anchor="middle" y="35" x="120"/><title>#18 Never +Type not computed + +[0] → #8 CTRL +[1] → #4 DATA</title><circle class="port" cx="80" cy="-3" r="3" fill="#536477"/><circle class="port" cx="160" cy="-3" r="3" fill="#536477"/><text class="slot" x="80" y="-10" text-anchor="middle">0</text><text class="slot" x="160" y="-10" text-anchor="middle">1</text></g><g class="node" id="n21" data-id="21" transform="translate(66,528)" style="opacity: 1;"><path class="box" d="M0,0H120V44H0Z" fill="#fff1c4"/><text class="label" text-anchor="middle" x="60" y="18"><tspan>Return</tspan><tspan class="node-id">  #21</tspan></text><text class="type" text-anchor="middle" y="35" x="60"/><title>#21 Return +Type not computed + +[0] → #1 CTRL +[1] → — DATA +[2] → #4 DATA</title><circle class="port" cx="30" cy="-3" r="3" fill="#536477"/><circle class="port" cx="60" cy="-3" r="3" fill="white"/><circle class="port" cx="90" cy="-3" r="3" fill="#536477"/><text class="slot" x="30" y="-10" text-anchor="middle">0</text><text class="slot" x="60" y="-10" text-anchor="middle">1</text><text class="slot" x="90" y="-10" text-anchor="middle">2</text></g></g><g class="region-heads" style="opacity: 1;"><g class="region-head" transform="translate(24,171)"><text class="label" x="26" y="17"><tspan>Loop</tspan><tspan class="node-id">  #8</tspan></text><title>Loop · 4 nodes</title><g class="fold-btn" role="button" tabindex="0" transform="translate(4,4)" aria-label="Fold region #8"><rect width="16" height="16" rx="2"/><text x="8" y="12" text-anchor="middle">−</text><title>Fold region</title></g></g></g><g class="shortcuts" style="opacity: 1;"/><g class="peep-ghosts" pointer-events="none"/></g></svg> diff --git a/chapter12/README.md b/chapter12/README.md index 28fbb6dc..49cc5e02 100644 --- a/chapter12/README.md +++ b/chapter12/README.md @@ -1,5 +1,8 @@ # Chapter 12: Floats +[Previous: Chapter 11](../chapter11/README.md) | +[Next: Chapter 13](../chapter13/README.md) + Memory keeps Chapter 11's single `$mem` binding and lazy `MemMerge`, `MemPhi`, and `BulkMemPhi` partitions. Start produces `{ctrl, $mem, arg}` and Return consumes `{ctrl, $mem, result}`; floating-point arithmetic needs no new memory @@ -30,7 +33,7 @@ There is no corresponding way right now to round a `flt` back to an `int`: int x = 3.14; // error ``` -Here is Newton's method to a square root: +Here is Newton's method for computing a square root: ```java flt guess = arg; // Initial guess is just argument while( true ) { @@ -52,11 +55,12 @@ Floating point operations have their own Nodes: | MinusF | Unary negate | | EQF, LTF, LEF | FP compare operators | -And their own section in the Type lattice: +Within the Type lattice, we add the following domain: -Within the Type Lattice, we now add the following domain: +*  - Float values. The same shape as the Integer values, but floats + with a top (`TOP`, ⊤), bottom (`BOT`, ⊥), and constants. -* <font style="background-color:aqua">Float type</font> - Float values. The same shape as the Integer values, but floats - with a TOP, BOT and constants +The other domains retain Chapter 10b's named structs, nullable pointers, and +precise memory aliases.  diff --git a/chapter12/docs/lattice.gv b/chapter12/docs/lattice.gv index 23b3f7a7..f3b5051c 100644 --- a/chapter12/docs/lattice.gv +++ b/chapter12/docs/lattice.gv @@ -1,182 +1,135 @@ digraph Lattice { - compound = true; - // Define nodes - splines=false; - node [shape=circle, style=filled]; - nodesep=0.6; - - TOP [label=<<B>⊤</B >>, fillcolor=black, fontcolor=white]; - BOT [label=<<B>⊥</B>>, fillcolor=black, fontcolor=white]; - - // ---------------------- - // Control - XCTRL [label=<<B>⊤</B >:ctrl>, fillcolor=yellow, shape=oval]; - CTRL [label=<<B>⊥</B>:ctrl>, fillcolor=yellow, shape=oval]; - - TOP -> XCTRL; - XCTRL -> CTRL; - CTRL -> BOT; - - // ---------------------- - // Integers - INT_TOP [label=<<B>⊤</B >:int>, fillcolor=lightblue, shape=oval]; - INT_BOT [label=<<B>⊥</B>:int>, fillcolor=lightblue, shape=oval]; - - INT_MINDOTS [label="...", fillcolor=lightblue, shape=oval]; - INT_ZERO [label="0" , fillcolor=lightblue]; - INT_MAXDOTS [label="...", fillcolor=lightblue, shape=oval]; - - TOP -> INT_TOP; - INT_TOP -> INT_MINDOTS; - INT_TOP -> INT_ZERO; - INT_TOP -> INT_MAXDOTS; - INT_MINDOTS -> INT_BOT; - INT_ZERO -> INT_BOT; - INT_MAXDOTS -> INT_BOT; - INT_BOT -> BOT; - - INT_MINDOTS -> INT_ZERO -> INT_MAXDOTS [style=invis]; - - // ---------------------- - // Floats - FLT_TOP [label=<<B>⊤</B >:flt>, fillcolor=aqua, shape=oval]; - FLT_BOT [label=<<B>⊥</B>:flt>, fillcolor=aqua, shape=oval]; - - FLT_MINDOTS [label="...", fillcolor=aqua, shape=oval]; - FLT_ZERO [label="0" , fillcolor=aqua]; - FLT_MAXDOTS [label="...", fillcolor=aqua, shape=oval]; - - TOP -> FLT_TOP; - FLT_TOP -> FLT_MINDOTS; - FLT_TOP -> FLT_ZERO; - FLT_TOP -> FLT_MAXDOTS; - FLT_MINDOTS -> FLT_BOT; - FLT_ZERO -> FLT_BOT; - FLT_MAXDOTS -> FLT_BOT; - FLT_BOT -> BOT; - - FLT_MINDOTS -> FLT_ZERO -> FLT_MAXDOTS [style=invis]; - - // ---------------------- - // Pointers, just a boolean nil/not and a struct - PTR [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="green"><FONT color="white">*ptr</FONT></TD></TR> - <TR><TD BGCOLOR="lightgreen">struct</TD></TR> - </TABLE> - >]; - PTR0 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="green"><FONT color="white">*ptr?</FONT></TD></TR> - <TR><TD BGCOLOR="lightgreen">struct</TD></TR> - </TABLE> - >]; - - TOP -> PTR; - PTR -> PTR0; - PTR0 -> BOT; - - // ---------------------- - // Structs - STRUCT_TOP [label=<<B>⊤</B >:struct>, fillcolor=lightgreen, shape=oval]; - STRUCT_BOT [label=<<B>⊥</B>:struct>, fillcolor=lightgreen, shape=oval]; - - STRUCT_S1 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - </TABLE> - >]; - STRUCT_S2 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - </TABLE> - >]; - STRUCT_SN [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - <TR><TD BGCOLOR="lightgreen">... </TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - </TABLE> - >]; - - - TOP -> STRUCT_TOP; - STRUCT_TOP -> STRUCT_S1; - STRUCT_TOP -> STRUCT_S2; - STRUCT_TOP -> STRUCT_SN; - STRUCT_S1 -> STRUCT_BOT; - STRUCT_S2 -> STRUCT_BOT; - STRUCT_SN -> STRUCT_BOT; - STRUCT_BOT -> BOT; - - STRUCT_S1 -> STRUCT_S2 -> STRUCT_SN [style=invis]; - - // ---------------------- - // Memory - MEM_TOP [label=<<B>⊤</B >:mem>, fillcolor=blue, fontcolor=white, shape=oval]; - MEM_BOT [label=<<B>⊥</B>:mem>, fillcolor=blue, fontcolor=white, shape=oval]; - MEM_ALIAS1 [label="#1" , fillcolor=blue, fontcolor=white]; - MEM_ALIASDOTS [label="..." , fillcolor=blue, fontcolor=white, shape=oval]; - MEM_ALIASN [label="#n" , fillcolor=blue, fontcolor=white]; - - TOP -> MEM_TOP; - MEM_TOP -> MEM_ALIAS1; - MEM_TOP -> MEM_ALIASDOTS; - MEM_TOP -> MEM_ALIASN; - MEM_ALIAS1 -> MEM_BOT; - MEM_ALIASDOTS -> MEM_BOT; - MEM_ALIASN -> MEM_BOT; - MEM_BOT -> BOT; - - MEM_ALIAS1 -> MEM_ALIASDOTS -> MEM_ALIASN [style=invis]; - - // ---------------------- - // Tuples - - TUPLE_TOP [label=<<B>⊤</B >:tuple>, fillcolor=pink, shape=oval]; - TUPLE_BOT [label=<<B>⊥</B>:tuple>, fillcolor=pink, shape=oval]; - - TUPLE1 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TH><TD BGCOLOR="pink">Tuple</TD></TH> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - </TABLE> - >]; - TUPLE2 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TH><TD BGCOLOR="pink">Tuple</TD></TH> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - </TABLE> - >]; - TUPLEN [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TH><TD BGCOLOR="pink">Tuple</TD></TH> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - <TR><TD BGCOLOR="black" ><FONT color="white">...</FONT></TD></TR> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - </TABLE> - >]; - - - TOP -> TUPLE_TOP; - TUPLE_TOP -> TUPLE1; - TUPLE_TOP -> TUPLE2; - TUPLE_TOP -> TUPLEN; - TUPLE1 -> TUPLE_BOT; - TUPLE2 -> TUPLE_BOT; - TUPLEN -> TUPLE_BOT; - TUPLE_BOT -> BOT; - - // ---------------------- - // Additional customization - {rank=same; TOP;} - {rank=same; INT_TOP; FLT_TOP; XCTRL; STRUCT_TOP; MEM_TOP; TUPLE_TOP} - {rank=same; INT_MINDOTS; INT_ZERO; INT_MAXDOTS; - FLT_MINDOTS; FLT_ZERO; FLT_MAXDOTS; - STRUCT_S1; STRUCT_S2; STRUCT_SN; - MEM_ALIAS1; MEM_ALIASDOTS; MEM_ALIASN;} - {rank=same; INT_BOT; FLT_BOT; CTRL; STRUCT_BOT; MEM_BOT; TUPLE_BOT} - {rank=same; BOT;} + rankdir=TB; + newrank=true; + // Preserve the same-rank ordering edges through cluster layout. + remincross=false; + nodesep=0.22; + ranksep=0.65; + node [shape=ellipse, style=filled, fontname="DejaVu Sans", fontsize=13]; + edge [color="#555555", arrowsize=0.6]; + + // These arrows are lattice-order edges, not use/definition edges. + TOP [label="⊤", fillcolor=black, fontcolor=white]; + BOT [label="⊥", fillcolor=black, fontcolor=white]; + + subgraph cluster_control { + label="Control"; fontname="Arial"; color="#cccccc"; + node [fillcolor="#ffff00"]; + XCTRL [label="⊤:ctrl"]; + CTRL [label="⊥:ctrl"]; + XCTRL -> CTRL; + } + + subgraph cluster_integer { + label="Integer"; fontname="Arial"; color="#cccccc"; + node [fillcolor="#add8e6"]; + INT_TOP [label="⊤:int"]; + INT_BOT [label="⊥:int"]; + INT_NEG [label="… −2, −1"]; + INT_ZERO [label="0"]; + INT_POS [label="1, 2, …"]; + {rank=same; INT_NEG; INT_ZERO; INT_POS;} + INT_NEG -> INT_ZERO -> INT_POS [style=invis]; + INT_TOP -> {INT_NEG INT_ZERO INT_POS}; + {INT_NEG INT_ZERO INT_POS} -> INT_BOT; + } + + subgraph cluster_float { + label="Float"; fontname="Arial"; color="#cccccc"; + FLT_TOP [label=<<B>⊤</B >:flt>, fillcolor=aqua, shape=oval]; + FLT_BOT [label=<<B>⊥</B>:flt>, fillcolor=aqua, shape=oval]; + + FLT_MINDOTS [label="… negative constants", fillcolor=aqua, shape=oval]; + FLT_ZERO [label="0.0" , fillcolor=aqua]; + FLT_MAXDOTS [label="positive constants …", fillcolor=aqua, shape=oval]; + + FLT_TOP -> FLT_MINDOTS; + FLT_TOP -> FLT_ZERO; + FLT_TOP -> FLT_MAXDOTS; + FLT_MINDOTS -> FLT_BOT; + FLT_ZERO -> FLT_BOT; + FLT_MAXDOTS -> FLT_BOT; + + FLT_MINDOTS -> FLT_ZERO -> FLT_MAXDOTS [style=invis]; + + {rank=same; FLT_MINDOTS; FLT_ZERO; FLT_MAXDOTS;} + } + + subgraph cluster_pointer { + label="Pointer = nullability × struct type"; + fontname="Arial"; color="#cccccc"; + node [fillcolor="#008000", fontcolor=white]; + PTR_TOP [label="⊤:ptr\n[*⊤:struct]"]; + PTR_BOT [label="⊥:ptr\n[*⊥:struct?]"]; + PTR_NULL [label="null"]; + PTR_ANY [label="*⊥:struct\n[ptr any struct]"]; + PTR_PERSON [label="*Person"]; + PTR_S1 [label="*s1"]; + PTR_MORE [label="*s2, …"]; + PTR_PERSON_NIL [label="*Person?"]; + PTR_S1_NIL [label="*s1?"]; + PTR_MORE_NIL [label="*s2?, …"]; + {rank=same; PTR_PERSON; PTR_S1; PTR_MORE; PTR_NULL;} + {rank=same; PTR_ANY; PTR_PERSON_NIL; PTR_S1_NIL; PTR_MORE_NIL;} + PTR_PERSON -> PTR_S1 -> PTR_MORE -> PTR_NULL [style=invis]; + PTR_ANY -> PTR_PERSON_NIL -> PTR_S1_NIL -> PTR_MORE_NIL [style=invis]; + PTR_TOP -> {PTR_PERSON PTR_S1 PTR_MORE PTR_NULL}; + {PTR_PERSON PTR_S1 PTR_MORE} -> PTR_ANY; + PTR_PERSON -> PTR_PERSON_NIL; + PTR_S1 -> PTR_S1_NIL; + PTR_MORE -> PTR_MORE_NIL; + PTR_NULL -> {PTR_PERSON_NIL PTR_S1_NIL PTR_MORE_NIL}; + {PTR_ANY PTR_PERSON_NIL PTR_S1_NIL PTR_MORE_NIL} -> PTR_BOT; + } + + subgraph cluster_struct { + label="Struct\nnamed collection of named scalar types"; + fontname="Arial"; color="#cccccc"; + node [fillcolor="#90ee90"]; + STRUCT_TOP [label="⊤:struct\n[struct top]"]; + STRUCT_BOT [label="⊥:struct\n[struct bottom]"]; + STRUCT_PERSON [label="Person\nage: int", shape=box]; + STRUCT_S1 [label="s1\nx: int", shape=box]; + STRUCT_S2 [label="s2\nx: int, y: flt", shape=box]; + STRUCT_MORE [label="…", shape=box]; + {rank=same; STRUCT_PERSON; STRUCT_S1; STRUCT_S2; STRUCT_MORE;} + STRUCT_PERSON -> STRUCT_S1 -> STRUCT_S2 -> STRUCT_MORE [style=invis]; + STRUCT_TOP -> {STRUCT_PERSON STRUCT_S1 STRUCT_S2 STRUCT_MORE}; + {STRUCT_PERSON STRUCT_S1 STRUCT_S2 STRUCT_MORE} -> STRUCT_BOT; + } + + subgraph cluster_memory { + label="Memory\nprecise alias slices"; fontname="Arial"; color="#cccccc"; + node [fillcolor="#00008b", fontcolor=white]; + MEM_TOP [label="⊤:mem"]; + MEM_BOT [label="⊥:mem"]; + MEM_ALIAS2 [label="MEM#2"]; + MEM_ALIAS3 [label="MEM#3"]; + MEM_MORE [label="…"]; + {rank=same; MEM_ALIAS2; MEM_ALIAS3; MEM_MORE;} + MEM_ALIAS2 -> MEM_ALIAS3 -> MEM_MORE [style=invis]; + MEM_TOP -> {MEM_ALIAS2 MEM_ALIAS3 MEM_MORE}; + {MEM_ALIAS2 MEM_ALIAS3 MEM_MORE} -> MEM_BOT; + } + + subgraph cluster_tuple { + label="Tuple\ncollection of types"; + fontname="Arial"; color="#cccccc"; + node [fillcolor="#ffc0cb"]; + TUPLE_TOP [label="⊤:tuple"]; + TUPLE_BOT [label="⊥:tuple"]; + TUPLE1 [label="(type)", shape=box]; + TUPLE2 [label="(type, type)", shape=box]; + TUPLEN [label="(type, …)", shape=box]; + {rank=same; TUPLE1; TUPLE2; TUPLEN;} + TUPLE1 -> TUPLE2 -> TUPLEN [style=invis]; + TUPLE_TOP -> {TUPLE1 TUPLE2 TUPLEN}; + {TUPLE1 TUPLE2 TUPLEN} -> TUPLE_BOT; + } + + TOP -> {XCTRL INT_TOP FLT_TOP PTR_TOP STRUCT_TOP MEM_TOP TUPLE_TOP}; + {CTRL INT_BOT FLT_BOT PTR_BOT STRUCT_BOT MEM_BOT TUPLE_BOT} -> BOT; + {rank=same; XCTRL; INT_TOP; FLT_TOP; PTR_TOP; STRUCT_TOP; MEM_TOP; TUPLE_TOP;} + {rank=same; CTRL; INT_BOT; FLT_BOT; PTR_BOT; STRUCT_BOT; MEM_BOT; TUPLE_BOT;} + XCTRL -> INT_TOP -> FLT_TOP -> PTR_TOP -> STRUCT_TOP -> MEM_TOP -> TUPLE_TOP [style=invis]; } diff --git a/chapter12/docs/lattice.svg b/chapter12/docs/lattice.svg index 1bb4f692..bc64abb6 100644 --- a/chapter12/docs/lattice.svg +++ b/chapter12/docs/lattice.svg @@ -1,598 +1,708 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<!-- Generated by graphviz version 12.2.0 (20241103.1931)
- -->
-<!-- Title: Lattice Pages: 1 -->
-<svg width="1602pt" height="440pt"
- viewBox="0.00 0.00 1601.51 440.50" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 436.5)">
-<title>Lattice</title>
-<polygon fill="white" stroke="none" points="-4,4 -4,-436.5 1597.51,-436.5 1597.51,4 -4,4"/>
-<!-- TOP -->
-<g id="node1" class="node">
-<title>TOP</title>
-<ellipse fill="black" stroke="black" cx="630.51" cy="-411.37" rx="21.12" ry="21.12"/>
-<text text-anchor="start" x="622.63" y="-406.95" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊤</text>
-</g>
-<!-- XCTRL -->
-<g id="node3" class="node">
-<title>XCTRL</title>
-<ellipse fill="yellow" stroke="black" cx="36.51" cy="-327.75" rx="36.51" ry="18"/>
-<text text-anchor="start" x="17.76" y="-323.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="33.51" y="-323.7" font-family="Times New Roman,serif" font-size="14.00">:ctrl</text>
-</g>
-<!-- TOP->XCTRL -->
-<g id="edge1" class="edge">
-<title>TOP->XCTRL</title>
-<path fill="none" stroke="black" d="M609.37,-407.47C523.96,-395.73 203.25,-351.66 82.7,-335.1"/>
-<polygon fill="black" stroke="black" points="83.22,-331.63 72.84,-333.74 82.27,-338.57 83.22,-331.63"/>
-</g>
-<!-- INT_TOP -->
-<g id="node5" class="node">
-<title>INT_TOP</title>
-<ellipse fill="lightblue" stroke="black" cx="226.51" cy="-327.75" rx="33.95" ry="18"/>
-<text text-anchor="start" x="209.63" y="-323.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="225.38" y="-323.7" font-family="Times New Roman,serif" font-size="14.00">:int</text>
-</g>
-<!-- TOP->INT_TOP -->
-<g id="edge4" class="edge">
-<title>TOP->INT_TOP</title>
-<path fill="none" stroke="black" d="M609.64,-406.16C546.23,-393.34 354.92,-354.69 269.04,-337.34"/>
-<polygon fill="black" stroke="black" points="269.87,-333.94 259.37,-335.39 268.48,-340.8 269.87,-333.94"/>
-</g>
-<!-- FLT_TOP -->
-<g id="node10" class="node">
-<title>FLT_TOP</title>
-<ellipse fill="aqua" stroke="black" cx="489.51" cy="-327.75" rx="32.41" ry="18"/>
-<text text-anchor="start" x="473.76" y="-323.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="489.51" y="-323.7" font-family="Times New Roman,serif" font-size="14.00">:flt</text>
-</g>
-<!-- TOP->FLT_TOP -->
-<g id="edge14" class="edge">
-<title>TOP->FLT_TOP</title>
-<path fill="none" stroke="black" d="M612.36,-399.87C589.31,-386.52 549.15,-363.27 521.04,-347"/>
-<polygon fill="black" stroke="black" points="523,-344.09 512.59,-342.11 519.49,-350.15 523,-344.09"/>
-</g>
-<!-- PTR -->
-<g id="node15" class="node">
-<title>PTR</title>
-<polygon fill="none" stroke="none" points="657.51,-354.25 603.51,-354.25 603.51,-301.25 657.51,-301.25 657.51,-354.25"/>
-<polygon fill="green" stroke="none" points="612.51,-327.75 612.51,-350.25 648.51,-350.25 648.51,-327.75 612.51,-327.75"/>
-<polygon fill="none" stroke="black" points="612.51,-327.75 612.51,-350.25 648.51,-350.25 648.51,-327.75 612.51,-327.75"/>
-<text text-anchor="start" x="619.63" y="-333.95" font-family="Times New Roman,serif" font-size="14.00" fill="white">*ptr</text>
-<polygon fill="lightgreen" stroke="none" points="612.51,-305.25 612.51,-327.75 648.51,-327.75 648.51,-305.25 612.51,-305.25"/>
-<polygon fill="none" stroke="black" points="612.51,-305.25 612.51,-327.75 648.51,-327.75 648.51,-305.25 612.51,-305.25"/>
-<text text-anchor="start" x="615.51" y="-311.45" font-family="Times New Roman,serif" font-size="14.00">struct</text>
-</g>
-<!-- TOP->PTR -->
-<g id="edge24" class="edge">
-<title>TOP->PTR</title>
-<path fill="none" stroke="black" d="M630.51,-389.78C630.51,-382.39 630.51,-373.83 630.51,-365.49"/>
-<polygon fill="black" stroke="black" points="634.01,-365.52 630.51,-355.52 627.01,-365.52 634.01,-365.52"/>
-</g>
-<!-- STRUCT_TOP -->
-<g id="node17" class="node">
-<title>STRUCT_TOP</title>
-<ellipse fill="lightgreen" stroke="black" cx="806.51" cy="-327.75" rx="44.7" ry="18"/>
-<text text-anchor="start" x="781.76" y="-323.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="797.51" y="-323.7" font-family="Times New Roman,serif" font-size="14.00">:struct</text>
-</g>
-<!-- TOP->STRUCT_TOP -->
-<g id="edge27" class="edge">
-<title>TOP->STRUCT_TOP</title>
-<path fill="none" stroke="black" d="M649.68,-401.48C677.9,-388.39 731.22,-363.66 767.79,-346.71"/>
-<polygon fill="black" stroke="black" points="769.12,-349.95 776.71,-342.57 766.17,-343.6 769.12,-349.95"/>
-</g>
-<!-- MEM_TOP -->
-<g id="node22" class="node">
-<title>MEM_TOP</title>
-<ellipse fill="blue" stroke="black" cx="1147.51" cy="-327.75" rx="43.67" ry="18"/>
-<text text-anchor="start" x="1123.51" y="-323.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊤</text>
-<text text-anchor="start" x="1139.26" y="-323.7" font-family="Times New Roman,serif" font-size="14.00" fill="white">:mem</text>
-</g>
-<!-- TOP->MEM_TOP -->
-<g id="edge37" class="edge">
-<title>TOP->MEM_TOP</title>
-<path fill="none" stroke="black" d="M651.42,-407.07C726.59,-395.2 984.56,-354.47 1095.79,-336.91"/>
-<polygon fill="black" stroke="black" points="1096.21,-340.39 1105.54,-335.37 1095.12,-333.48 1096.21,-340.39"/>
-</g>
-<!-- TUPLE_TOP -->
-<g id="node27" class="node">
-<title>TUPLE_TOP</title>
-<ellipse fill="pink" stroke="black" cx="1420.51" cy="-327.75" rx="42.65" ry="18"/>
-<text text-anchor="start" x="1397.26" y="-323.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="1413.01" y="-323.7" font-family="Times New Roman,serif" font-size="14.00">:tuple</text>
-</g>
-<!-- TOP->TUPLE_TOP -->
-<g id="edge47" class="edge">
-<title>TOP->TUPLE_TOP</title>
-<path fill="none" stroke="black" d="M651.64,-408.19C755.41,-397.47 1212.34,-350.26 1368.21,-334.15"/>
-<polygon fill="black" stroke="black" points="1368.24,-337.67 1377.83,-333.16 1367.52,-330.7 1368.24,-337.67"/>
-</g>
-<!-- BOT -->
-<g id="node2" class="node">
-<title>BOT</title>
-<ellipse fill="black" stroke="black" cx="630.51" cy="-21.12" rx="21.12" ry="21.12"/>
-<text text-anchor="start" x="622.63" y="-16.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊥</text>
-</g>
-<!-- CTRL -->
-<g id="node4" class="node">
-<title>CTRL</title>
-<ellipse fill="yellow" stroke="black" cx="36.51" cy="-104.75" rx="36.51" ry="18"/>
-<text text-anchor="start" x="17.76" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="33.51" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:ctrl</text>
-</g>
-<!-- XCTRL->CTRL -->
-<g id="edge2" class="edge">
-<title>XCTRL->CTRL</title>
-<path fill="none" stroke="black" d="M36.51,-309.5C36.51,-271.02 36.51,-181.25 36.51,-134.4"/>
-<polygon fill="black" stroke="black" points="40.01,-134.45 36.51,-124.45 33.01,-134.45 40.01,-134.45"/>
-</g>
-<!-- CTRL->BOT -->
-<g id="edge3" class="edge">
-<title>CTRL->BOT</title>
-<path fill="none" stroke="black" d="M71.45,-98.95C177.66,-84.35 495.68,-40.65 598.24,-26.56"/>
-<polygon fill="black" stroke="black" points="598.46,-30.06 607.89,-25.23 597.5,-23.13 598.46,-30.06"/>
-</g>
-<!-- INT_MINDOTS -->
-<g id="node7" class="node">
-<title>INT_MINDOTS</title>
-<ellipse fill="lightblue" stroke="black" cx="89.51" cy="-216.25" rx="27" ry="18"/>
-<text text-anchor="middle" x="89.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">...</text>
-</g>
-<!-- INT_TOP->INT_MINDOTS -->
-<g id="edge5" class="edge">
-<title>INT_TOP->INT_MINDOTS</title>
-<path fill="none" stroke="black" d="M208.32,-312.21C184.36,-293.06 142.09,-259.28 114.97,-237.6"/>
-<polygon fill="black" stroke="black" points="117.24,-234.93 107.24,-231.42 112.87,-240.4 117.24,-234.93"/>
-</g>
-<!-- INT_ZERO -->
-<g id="node8" class="node">
-<title>INT_ZERO</title>
-<ellipse fill="lightblue" stroke="black" cx="177.51" cy="-216.25" rx="18" ry="18"/>
-<text text-anchor="middle" x="177.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">0</text>
-</g>
-<!-- INT_TOP->INT_ZERO -->
-<g id="edge6" class="edge">
-<title>INT_TOP->INT_ZERO</title>
-<path fill="none" stroke="black" d="M219.07,-310.12C211.12,-292.37 198.43,-264.01 189.16,-243.29"/>
-<polygon fill="black" stroke="black" points="192.44,-242.05 185.16,-234.35 186.05,-244.91 192.44,-242.05"/>
-</g>
-<!-- INT_MAXDOTS -->
-<g id="node9" class="node">
-<title>INT_MAXDOTS</title>
-<ellipse fill="lightblue" stroke="black" cx="265.51" cy="-216.25" rx="27" ry="18"/>
-<text text-anchor="middle" x="265.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">...</text>
-</g>
-<!-- INT_TOP->INT_MAXDOTS -->
-<g id="edge7" class="edge">
-<title>INT_TOP->INT_MAXDOTS</title>
-<path fill="none" stroke="black" d="M232.6,-309.64C238.76,-292.36 248.36,-265.39 255.61,-245.04"/>
-<polygon fill="black" stroke="black" points="258.89,-246.26 258.95,-235.66 252.3,-243.91 258.89,-246.26"/>
-</g>
-<!-- INT_BOT -->
-<g id="node6" class="node">
-<title>INT_BOT</title>
-<ellipse fill="lightblue" stroke="black" cx="226.51" cy="-104.75" rx="33.95" ry="18"/>
-<text text-anchor="start" x="209.63" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="225.38" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:int</text>
-</g>
-<!-- INT_BOT->BOT -->
-<g id="edge11" class="edge">
-<title>INT_BOT->BOT</title>
-<path fill="none" stroke="black" d="M257.87,-97.41C333.02,-82.23 522.71,-43.9 598.5,-28.59"/>
-<polygon fill="black" stroke="black" points="599.06,-32.05 608.17,-26.64 597.68,-25.19 599.06,-32.05"/>
-</g>
-<!-- INT_MINDOTS->INT_BOT -->
-<g id="edge8" class="edge">
-<title>INT_MINDOTS->INT_BOT</title>
-<path fill="none" stroke="black" d="M106.31,-201.82C129.55,-183.25 171.76,-149.5 199.47,-127.36"/>
-<polygon fill="black" stroke="black" points="201.45,-130.25 207.08,-121.28 197.08,-124.79 201.45,-130.25"/>
-</g>
-<!-- INT_MINDOTS->INT_ZERO -->
-<!-- INT_ZERO->INT_BOT -->
-<g id="edge9" class="edge">
-<title>INT_ZERO->INT_BOT</title>
-<path fill="none" stroke="black" d="M184.53,-199.56C192.29,-182.22 204.94,-153.96 214.32,-132.98"/>
-<polygon fill="black" stroke="black" points="217.51,-134.42 218.4,-123.87 211.12,-131.56 217.51,-134.42"/>
-</g>
-<!-- INT_ZERO->INT_MAXDOTS -->
-<!-- INT_MAXDOTS->INT_BOT -->
-<g id="edge10" class="edge">
-<title>INT_MAXDOTS->INT_BOT</title>
-<path fill="none" stroke="black" d="M259.59,-198.62C253.44,-181.35 243.71,-154.05 236.4,-133.51"/>
-<polygon fill="black" stroke="black" points="239.78,-132.57 233.12,-124.32 233.18,-134.92 239.78,-132.57"/>
-</g>
-<!-- FLT_MINDOTS -->
-<g id="node12" class="node">
-<title>FLT_MINDOTS</title>
-<ellipse fill="aqua" stroke="black" cx="362.51" cy="-216.25" rx="27" ry="18"/>
-<text text-anchor="middle" x="362.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">...</text>
-</g>
-<!-- FLT_TOP->FLT_MINDOTS -->
-<g id="edge15" class="edge">
-<title>FLT_TOP->FLT_MINDOTS</title>
-<path fill="none" stroke="black" d="M472.38,-311.98C450.43,-293.06 412.23,-260.12 387.15,-238.5"/>
-<polygon fill="black" stroke="black" points="389.57,-235.96 379.71,-232.08 385,-241.26 389.57,-235.96"/>
-</g>
-<!-- FLT_ZERO -->
-<g id="node13" class="node">
-<title>FLT_ZERO</title>
-<ellipse fill="aqua" stroke="black" cx="450.51" cy="-216.25" rx="18" ry="18"/>
-<text text-anchor="middle" x="450.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">0</text>
-</g>
-<!-- FLT_TOP->FLT_ZERO -->
-<g id="edge16" class="edge">
-<title>FLT_TOP->FLT_ZERO</title>
-<path fill="none" stroke="black" d="M483.42,-309.64C477.19,-292.16 467.43,-264.76 460.16,-244.33"/>
-<polygon fill="black" stroke="black" points="463.47,-243.2 456.81,-234.95 456.87,-245.54 463.47,-243.2"/>
-</g>
-<!-- FLT_MAXDOTS -->
-<g id="node14" class="node">
-<title>FLT_MAXDOTS</title>
-<ellipse fill="aqua" stroke="black" cx="538.51" cy="-216.25" rx="27" ry="18"/>
-<text text-anchor="middle" x="538.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">...</text>
-</g>
-<!-- FLT_TOP->FLT_MAXDOTS -->
-<g id="edge17" class="edge">
-<title>FLT_TOP->FLT_MAXDOTS</title>
-<path fill="none" stroke="black" d="M496.95,-310.12C504.76,-292.67 517.15,-264.98 526.38,-244.36"/>
-<polygon fill="black" stroke="black" points="529.49,-245.97 530.38,-235.42 523.1,-243.12 529.49,-245.97"/>
-</g>
-<!-- FLT_BOT -->
-<g id="node11" class="node">
-<title>FLT_BOT</title>
-<ellipse fill="aqua" stroke="black" cx="489.51" cy="-104.75" rx="32.41" ry="18"/>
-<text text-anchor="start" x="473.76" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="489.51" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:flt</text>
-</g>
-<!-- FLT_BOT->BOT -->
-<g id="edge21" class="edge">
-<title>FLT_BOT->BOT</title>
-<path fill="none" stroke="black" d="M511.23,-91.17C535.78,-76.96 575.81,-53.79 602.65,-38.25"/>
-<polygon fill="black" stroke="black" points="604.36,-41.31 611.26,-33.27 600.85,-35.25 604.36,-41.31"/>
-</g>
-<!-- FLT_MINDOTS->FLT_BOT -->
-<g id="edge18" class="edge">
-<title>FLT_MINDOTS->FLT_BOT</title>
-<path fill="none" stroke="black" d="M378.59,-201.38C400.21,-182.74 438.85,-149.43 464.33,-127.46"/>
-<polygon fill="black" stroke="black" points="466.31,-130.37 471.6,-121.19 461.74,-125.07 466.31,-130.37"/>
-</g>
-<!-- FLT_MINDOTS->FLT_ZERO -->
-<!-- FLT_ZERO->FLT_BOT -->
-<g id="edge19" class="edge">
-<title>FLT_ZERO->FLT_BOT</title>
-<path fill="none" stroke="black" d="M456.26,-199.09C462.41,-181.82 472.27,-154.14 479.66,-133.39"/>
-<polygon fill="black" stroke="black" points="482.91,-134.71 482.97,-124.12 476.31,-132.36 482.91,-134.71"/>
-</g>
-<!-- FLT_ZERO->FLT_MAXDOTS -->
-<!-- FLT_MAXDOTS->FLT_BOT -->
-<g id="edge20" class="edge">
-<title>FLT_MAXDOTS->FLT_BOT</title>
-<path fill="none" stroke="black" d="M531.07,-198.62C523.26,-181.17 510.87,-153.48 501.64,-132.86"/>
-<polygon fill="black" stroke="black" points="504.92,-131.62 497.64,-123.92 498.53,-134.47 504.92,-131.62"/>
-</g>
-<!-- PTR0 -->
-<g id="node16" class="node">
-<title>PTR0</title>
-<polygon fill="none" stroke="none" points="657.51,-131.25 603.51,-131.25 603.51,-78.25 657.51,-78.25 657.51,-131.25"/>
-<polygon fill="green" stroke="none" points="612.51,-104.75 612.51,-127.25 648.51,-127.25 648.51,-104.75 612.51,-104.75"/>
-<polygon fill="none" stroke="black" points="612.51,-104.75 612.51,-127.25 648.51,-127.25 648.51,-104.75 612.51,-104.75"/>
-<text text-anchor="start" x="616.63" y="-110.95" font-family="Times New Roman,serif" font-size="14.00" fill="white">*ptr?</text>
-<polygon fill="lightgreen" stroke="none" points="612.51,-82.25 612.51,-104.75 648.51,-104.75 648.51,-82.25 612.51,-82.25"/>
-<polygon fill="none" stroke="black" points="612.51,-82.25 612.51,-104.75 648.51,-104.75 648.51,-82.25 612.51,-82.25"/>
-<text text-anchor="start" x="615.51" y="-88.45" font-family="Times New Roman,serif" font-size="14.00">struct</text>
-</g>
-<!-- PTR->PTR0 -->
-<g id="edge25" class="edge">
-<title>PTR->PTR0</title>
-<path fill="none" stroke="black" d="M630.51,-301.29C630.51,-261.89 630.51,-187.62 630.51,-142.52"/>
-<polygon fill="black" stroke="black" points="634.01,-142.68 630.51,-132.68 627.01,-142.68 634.01,-142.68"/>
-</g>
-<!-- PTR0->BOT -->
-<g id="edge26" class="edge">
-<title>PTR0->BOT</title>
-<path fill="none" stroke="black" d="M630.51,-78.37C630.51,-70.63 630.51,-62.03 630.51,-53.93"/>
-<polygon fill="black" stroke="black" points="634.01,-54.09 630.51,-44.09 627.01,-54.09 634.01,-54.09"/>
-</g>
-<!-- STRUCT_S1 -->
-<g id="node19" class="node">
-<title>STRUCT_S1</title>
-<polygon fill="none" stroke="none" points="781.38,-234.25 695.63,-234.25 695.63,-198.25 781.38,-198.25 781.38,-234.25"/>
-<polygon fill="lightgreen" stroke="none" points="703.63,-205 703.63,-227.5 734.38,-227.5 734.38,-205 703.63,-205"/>
-<polygon fill="none" stroke="black" points="703.63,-205 703.63,-227.5 734.38,-227.5 734.38,-205 703.63,-205"/>
-<text text-anchor="start" x="706.63" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_0" gradientUnits="userSpaceOnUse" x1="740.1" y1="-224.2" x2="767.67" y2="-208.29" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_0)" stroke="none" points="734.38,-205 734.38,-227.5 773.38,-227.5 773.38,-205 734.38,-205"/>
-<polygon fill="none" stroke="black" points="734.38,-205 734.38,-227.5 773.38,-227.5 773.38,-205 734.38,-205"/>
-<text text-anchor="start" x="737.38" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-</g>
-<!-- STRUCT_TOP->STRUCT_S1 -->
-<g id="edge28" class="edge">
-<title>STRUCT_TOP->STRUCT_S1</title>
-<path fill="none" stroke="black" d="M796.18,-310.12C785.25,-292.51 767.83,-264.46 754.99,-243.79"/>
-<polygon fill="black" stroke="black" points="757.98,-241.97 749.73,-235.32 752.03,-245.66 757.98,-241.97"/>
-</g>
-<!-- STRUCT_S2 -->
-<g id="node20" class="node">
-<title>STRUCT_S2</title>
-<polygon fill="none" stroke="none" points="910.38,-242.75 824.63,-242.75 824.63,-189.75 910.38,-189.75 910.38,-242.75"/>
-<polygon fill="lightgreen" stroke="none" points="832.63,-216.25 832.63,-238.75 863.38,-238.75 863.38,-216.25 832.63,-216.25"/>
-<polygon fill="none" stroke="black" points="832.63,-216.25 832.63,-238.75 863.38,-238.75 863.38,-216.25 832.63,-216.25"/>
-<text text-anchor="start" x="835.63" y="-222.45" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_1" gradientUnits="userSpaceOnUse" x1="869.1" y1="-235.45" x2="896.67" y2="-219.54" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_1)" stroke="none" points="863.38,-216.25 863.38,-238.75 902.38,-238.75 902.38,-216.25 863.38,-216.25"/>
-<polygon fill="none" stroke="black" points="863.38,-216.25 863.38,-238.75 902.38,-238.75 902.38,-216.25 863.38,-216.25"/>
-<text text-anchor="start" x="866.38" y="-222.45" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-<polygon fill="lightgreen" stroke="none" points="832.63,-193.75 832.63,-216.25 863.38,-216.25 863.38,-193.75 832.63,-193.75"/>
-<polygon fill="none" stroke="black" points="832.63,-193.75 832.63,-216.25 863.38,-216.25 863.38,-193.75 832.63,-193.75"/>
-<text text-anchor="start" x="835.63" y="-199.95" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_2" gradientUnits="userSpaceOnUse" x1="869.1" y1="-212.95" x2="896.67" y2="-197.04" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_2)" stroke="none" points="863.38,-193.75 863.38,-216.25 902.38,-216.25 902.38,-193.75 863.38,-193.75"/>
-<polygon fill="none" stroke="black" points="863.38,-193.75 863.38,-216.25 902.38,-216.25 902.38,-193.75 863.38,-193.75"/>
-<text text-anchor="start" x="866.38" y="-199.95" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-</g>
-<!-- STRUCT_TOP->STRUCT_S2 -->
-<g id="edge29" class="edge">
-<title>STRUCT_TOP->STRUCT_S2</title>
-<path fill="none" stroke="black" d="M815.77,-310.12C824.25,-294.9 837.07,-271.89 847.82,-252.58"/>
-<polygon fill="black" stroke="black" points="850.84,-254.36 852.65,-243.92 844.73,-250.95 850.84,-254.36"/>
-</g>
-<!-- STRUCT_SN -->
-<g id="node21" class="node">
-<title>STRUCT_SN</title>
-<polygon fill="none" stroke="none" points="1039.38,-254 953.63,-254 953.63,-178.5 1039.38,-178.5 1039.38,-254"/>
-<polygon fill="lightgreen" stroke="none" points="961.63,-227.5 961.63,-250 992.38,-250 992.38,-227.5 961.63,-227.5"/>
-<polygon fill="none" stroke="black" points="961.63,-227.5 961.63,-250 992.38,-250 992.38,-227.5 961.63,-227.5"/>
-<text text-anchor="start" x="964.63" y="-233.7" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_3" gradientUnits="userSpaceOnUse" x1="998.1" y1="-246.7" x2="1025.67" y2="-230.79" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_3)" stroke="none" points="992.38,-227.5 992.38,-250 1031.38,-250 1031.38,-227.5 992.38,-227.5"/>
-<polygon fill="none" stroke="black" points="992.38,-227.5 992.38,-250 1031.38,-250 1031.38,-227.5 992.38,-227.5"/>
-<text text-anchor="start" x="995.38" y="-233.7" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-<polygon fill="lightgreen" stroke="none" points="961.63,-205 961.63,-227.5 992.38,-227.5 992.38,-205 961.63,-205"/>
-<polygon fill="none" stroke="black" points="961.63,-205 961.63,-227.5 992.38,-227.5 992.38,-205 961.63,-205"/>
-<text text-anchor="start" x="967.63" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">...  </text>
-<defs>
-<linearGradient id="l_4" gradientUnits="userSpaceOnUse" x1="998.1" y1="-224.2" x2="1025.67" y2="-208.29" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_4)" stroke="none" points="992.38,-205 992.38,-227.5 1031.38,-227.5 1031.38,-205 992.38,-205"/>
-<polygon fill="none" stroke="black" points="992.38,-205 992.38,-227.5 1031.38,-227.5 1031.38,-205 992.38,-205"/>
-<text text-anchor="start" x="995.38" y="-211.2" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-<polygon fill="lightgreen" stroke="none" points="961.63,-182.5 961.63,-205 992.38,-205 992.38,-182.5 961.63,-182.5"/>
-<polygon fill="none" stroke="black" points="961.63,-182.5 961.63,-205 992.38,-205 992.38,-182.5 961.63,-182.5"/>
-<text text-anchor="start" x="964.63" y="-188.7" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_5" gradientUnits="userSpaceOnUse" x1="998.1" y1="-201.7" x2="1025.67" y2="-185.79" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_5)" stroke="none" points="992.38,-182.5 992.38,-205 1031.38,-205 1031.38,-182.5 992.38,-182.5"/>
-<polygon fill="none" stroke="black" points="992.38,-182.5 992.38,-205 1031.38,-205 1031.38,-182.5 992.38,-182.5"/>
-<text text-anchor="start" x="995.38" y="-188.7" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-</g>
-<!-- STRUCT_TOP->STRUCT_SN -->
-<g id="edge30" class="edge">
-<title>STRUCT_TOP->STRUCT_SN</title>
-<path fill="none" stroke="black" d="M831.35,-312.43C859.88,-295.99 907.49,-268.55 944.28,-247.35"/>
-<polygon fill="black" stroke="black" points="945.64,-250.61 952.55,-242.58 942.14,-244.54 945.64,-250.61"/>
-</g>
-<!-- STRUCT_BOT -->
-<g id="node18" class="node">
-<title>STRUCT_BOT</title>
-<ellipse fill="lightgreen" stroke="black" cx="806.51" cy="-104.75" rx="44.7" ry="18"/>
-<text text-anchor="start" x="781.76" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="797.51" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:struct</text>
-</g>
-<!-- STRUCT_BOT->BOT -->
-<g id="edge34" class="edge">
-<title>STRUCT_BOT->BOT</title>
-<path fill="none" stroke="black" d="M777.84,-90.45C745.37,-75.39 692.74,-50.98 659.95,-35.78"/>
-<polygon fill="black" stroke="black" points="661.57,-32.67 651.03,-31.64 658.63,-39.02 661.57,-32.67"/>
-</g>
-<!-- STRUCT_S1->STRUCT_BOT -->
-<g id="edge31" class="edge">
-<title>STRUCT_S1->STRUCT_BOT</title>
-<path fill="none" stroke="black" d="M748.84,-198.62C759.77,-181.01 777.19,-152.96 790.02,-132.29"/>
-<polygon fill="black" stroke="black" points="792.98,-134.16 795.29,-123.82 787.04,-130.47 792.98,-134.16"/>
-</g>
-<!-- STRUCT_S1->STRUCT_S2 -->
-<!-- STRUCT_S2->STRUCT_BOT -->
-<g id="edge32" class="edge">
-<title>STRUCT_S2->STRUCT_BOT</title>
-<path fill="none" stroke="black" d="M853.36,-189.85C843.77,-172.63 831.12,-149.92 821.38,-132.44"/>
-<polygon fill="black" stroke="black" points="824.68,-131.18 816.76,-124.15 818.57,-134.59 824.68,-131.18"/>
-</g>
-<!-- STRUCT_S2->STRUCT_SN -->
-<!-- STRUCT_SN->STRUCT_BOT -->
-<g id="edge33" class="edge">
-<title>STRUCT_SN->STRUCT_BOT</title>
-<path fill="none" stroke="black" d="M953.87,-190.67C919.81,-171.04 872.69,-143.89 840.98,-125.62"/>
-<polygon fill="black" stroke="black" points="842.99,-122.73 832.58,-120.77 839.49,-128.8 842.99,-122.73"/>
-</g>
-<!-- MEM_ALIAS1 -->
-<g id="node24" class="node">
-<title>MEM_ALIAS1</title>
-<ellipse fill="blue" stroke="black" cx="1102.51" cy="-216.25" rx="20.13" ry="20.13"/>
-<text text-anchor="middle" x="1102.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00" fill="white">#1</text>
-</g>
-<!-- MEM_TOP->MEM_ALIAS1 -->
-<g id="edge38" class="edge">
-<title>MEM_TOP->MEM_ALIAS1</title>
-<path fill="none" stroke="black" d="M1140.48,-309.64C1133.47,-292.59 1122.58,-266.09 1114.26,-245.84"/>
-<polygon fill="black" stroke="black" points="1117.55,-244.65 1110.52,-236.73 1111.08,-247.31 1117.55,-244.65"/>
-</g>
-<!-- MEM_ALIASDOTS -->
-<g id="node25" class="node">
-<title>MEM_ALIASDOTS</title>
-<ellipse fill="blue" stroke="black" cx="1192.51" cy="-216.25" rx="27" ry="18"/>
-<text text-anchor="middle" x="1192.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00" fill="white">...</text>
-</g>
-<!-- MEM_TOP->MEM_ALIASDOTS -->
-<g id="edge39" class="edge">
-<title>MEM_TOP->MEM_ALIASDOTS</title>
-<path fill="none" stroke="black" d="M1154.54,-309.64C1161.71,-292.18 1172.96,-264.82 1181.35,-244.4"/>
-<polygon fill="black" stroke="black" points="1184.54,-245.86 1185.1,-235.28 1178.06,-243.2 1184.54,-245.86"/>
-</g>
-<!-- MEM_ALIASN -->
-<g id="node26" class="node">
-<title>MEM_ALIASN</title>
-<ellipse fill="blue" stroke="black" cx="1282.51" cy="-216.25" rx="20.13" ry="20.13"/>
-<text text-anchor="middle" x="1282.51" y="-211.2" font-family="Times New Roman,serif" font-size="14.00" fill="white">#n</text>
-</g>
-<!-- MEM_TOP->MEM_ALIASN -->
-<g id="edge40" class="edge">
-<title>MEM_TOP->MEM_ALIASN</title>
-<path fill="none" stroke="black" d="M1166.56,-311.29C1190.65,-291.76 1232.11,-258.13 1258.38,-236.82"/>
-<polygon fill="black" stroke="black" points="1260.57,-239.55 1266.13,-230.53 1256.16,-234.11 1260.57,-239.55"/>
-</g>
-<!-- MEM_BOT -->
-<g id="node23" class="node">
-<title>MEM_BOT</title>
-<ellipse fill="blue" stroke="black" cx="1147.51" cy="-104.75" rx="43.67" ry="18"/>
-<text text-anchor="start" x="1123.51" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊥</text>
-<text text-anchor="start" x="1139.26" y="-100.7" font-family="Times New Roman,serif" font-size="14.00" fill="white">:mem</text>
-</g>
-<!-- MEM_BOT->BOT -->
-<g id="edge44" class="edge">
-<title>MEM_BOT->BOT</title>
-<path fill="none" stroke="black" d="M1107.37,-97.41C1008.15,-81.75 752.85,-41.44 662.66,-27.2"/>
-<polygon fill="black" stroke="black" points="663.45,-23.78 653.03,-25.68 662.36,-30.7 663.45,-23.78"/>
-</g>
-<!-- MEM_ALIAS1->MEM_BOT -->
-<g id="edge41" class="edge">
-<title>MEM_ALIAS1->MEM_BOT</title>
-<path fill="none" stroke="black" d="M1109.94,-197.17C1117.07,-179.82 1127.93,-153.39 1136.15,-133.4"/>
-<polygon fill="black" stroke="black" points="1139.37,-134.75 1139.94,-124.17 1132.9,-132.09 1139.37,-134.75"/>
-</g>
-<!-- MEM_ALIAS1->MEM_ALIASDOTS -->
-<!-- MEM_ALIASDOTS->MEM_BOT -->
-<g id="edge42" class="edge">
-<title>MEM_ALIASDOTS->MEM_BOT</title>
-<path fill="none" stroke="black" d="M1185.67,-198.62C1178.58,-181.35 1167.36,-154.05 1158.92,-133.51"/>
-<polygon fill="black" stroke="black" points="1162.17,-132.22 1155.13,-124.3 1155.7,-134.88 1162.17,-132.22"/>
-</g>
-<!-- MEM_ALIASDOTS->MEM_ALIASN -->
-<!-- MEM_ALIASN->MEM_BOT -->
-<g id="edge43" class="edge">
-<title>MEM_ALIASN->MEM_BOT</title>
-<path fill="none" stroke="black" d="M1267.02,-202.69C1244.75,-184.62 1203.29,-151 1175.55,-128.49"/>
-<polygon fill="black" stroke="black" points="1177.86,-125.86 1167.89,-122.28 1173.45,-131.3 1177.86,-125.86"/>
-</g>
-<!-- TUPLE1 -->
-<g id="node29" class="node">
-<title>TUPLE1</title>
-<polygon fill="none" stroke="none" points="1399.51,-242.75 1345.51,-242.75 1345.51,-189.75 1399.51,-189.75 1399.51,-242.75"/>
-<polygon fill="pink" stroke="none" points="1353.76,-216.25 1353.76,-238.75 1391.26,-238.75 1391.26,-216.25 1353.76,-216.25"/>
-<polygon fill="none" stroke="black" points="1353.76,-216.25 1353.76,-238.75 1391.26,-238.75 1391.26,-216.25 1353.76,-216.25"/>
-<text text-anchor="start" x="1356.76" y="-222.45" font-family="Times New Roman,serif" font-size="14.00">Tuple</text>
-<polygon fill="black" stroke="none" points="1353.76,-193.75 1353.76,-216.25 1391.26,-216.25 1391.26,-193.75 1353.76,-193.75"/>
-<polygon fill="none" stroke="black" points="1353.76,-193.75 1353.76,-216.25 1391.26,-216.25 1391.26,-193.75 1353.76,-193.75"/>
-<text text-anchor="start" x="1360.88" y="-199.95" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-</g>
-<!-- TUPLE_TOP->TUPLE1 -->
-<g id="edge48" class="edge">
-<title>TUPLE_TOP->TUPLE1</title>
-<path fill="none" stroke="black" d="M1413.01,-309.64C1406.37,-294.48 1396.45,-271.87 1388.1,-252.81"/>
-<polygon fill="black" stroke="black" points="1391.35,-251.51 1384.13,-243.76 1384.94,-254.32 1391.35,-251.51"/>
-</g>
-<!-- TUPLE2 -->
-<g id="node30" class="node">
-<title>TUPLE2</title>
-<polygon fill="none" stroke="none" points="1496.51,-254 1442.51,-254 1442.51,-178.5 1496.51,-178.5 1496.51,-254"/>
-<polygon fill="pink" stroke="none" points="1450.76,-227.5 1450.76,-250 1488.26,-250 1488.26,-227.5 1450.76,-227.5"/>
-<polygon fill="none" stroke="black" points="1450.76,-227.5 1450.76,-250 1488.26,-250 1488.26,-227.5 1450.76,-227.5"/>
-<text text-anchor="start" x="1453.76" y="-233.7" font-family="Times New Roman,serif" font-size="14.00">Tuple</text>
-<polygon fill="black" stroke="none" points="1450.76,-205 1450.76,-227.5 1488.26,-227.5 1488.26,-205 1450.76,-205"/>
-<polygon fill="none" stroke="black" points="1450.76,-205 1450.76,-227.5 1488.26,-227.5 1488.26,-205 1450.76,-205"/>
-<text text-anchor="start" x="1457.88" y="-211.2" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-<polygon fill="black" stroke="none" points="1450.76,-182.5 1450.76,-205 1488.26,-205 1488.26,-182.5 1450.76,-182.5"/>
-<polygon fill="none" stroke="black" points="1450.76,-182.5 1450.76,-205 1488.26,-205 1488.26,-182.5 1450.76,-182.5"/>
-<text text-anchor="start" x="1457.88" y="-188.7" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-</g>
-<!-- TUPLE_TOP->TUPLE2 -->
-<g id="edge49" class="edge">
-<title>TUPLE_TOP->TUPLE2</title>
-<path fill="none" stroke="black" d="M1428.17,-309.64C1433.64,-297.4 1441.29,-280.3 1448.53,-264.14"/>
-<polygon fill="black" stroke="black" points="1451.68,-265.65 1452.57,-255.09 1445.3,-262.79 1451.68,-265.65"/>
-</g>
-<!-- TUPLEN -->
-<g id="node31" class="node">
-<title>TUPLEN</title>
-<polygon fill="none" stroke="none" points="1593.51,-265.25 1539.51,-265.25 1539.51,-167.25 1593.51,-167.25 1593.51,-265.25"/>
-<polygon fill="pink" stroke="none" points="1547.76,-238.75 1547.76,-261.25 1585.26,-261.25 1585.26,-238.75 1547.76,-238.75"/>
-<polygon fill="none" stroke="black" points="1547.76,-238.75 1547.76,-261.25 1585.26,-261.25 1585.26,-238.75 1547.76,-238.75"/>
-<text text-anchor="start" x="1550.76" y="-244.95" font-family="Times New Roman,serif" font-size="14.00">Tuple</text>
-<polygon fill="black" stroke="none" points="1547.76,-216.25 1547.76,-238.75 1585.26,-238.75 1585.26,-216.25 1547.76,-216.25"/>
-<polygon fill="none" stroke="black" points="1547.76,-216.25 1547.76,-238.75 1585.26,-238.75 1585.26,-216.25 1547.76,-216.25"/>
-<text text-anchor="start" x="1554.88" y="-222.45" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-<polygon fill="black" stroke="none" points="1547.76,-193.75 1547.76,-216.25 1585.26,-216.25 1585.26,-193.75 1547.76,-193.75"/>
-<polygon fill="none" stroke="black" points="1547.76,-193.75 1547.76,-216.25 1585.26,-216.25 1585.26,-193.75 1547.76,-193.75"/>
-<text text-anchor="start" x="1560.88" y="-199.95" font-family="Times New Roman,serif" font-size="14.00" fill="white">...</text>
-<polygon fill="black" stroke="none" points="1547.76,-171.25 1547.76,-193.75 1585.26,-193.75 1585.26,-171.25 1547.76,-171.25"/>
-<polygon fill="none" stroke="black" points="1547.76,-171.25 1547.76,-193.75 1585.26,-193.75 1585.26,-171.25 1547.76,-171.25"/>
-<text text-anchor="start" x="1554.88" y="-177.45" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-</g>
-<!-- TUPLE_TOP->TUPLEN -->
-<g id="edge50" class="edge">
-<title>TUPLE_TOP->TUPLEN</title>
-<path fill="none" stroke="black" d="M1440.81,-311.52C1463.97,-294.15 1502.28,-265.42 1530.53,-244.23"/>
-<polygon fill="black" stroke="black" points="1532.58,-247.07 1538.48,-238.27 1528.38,-241.47 1532.58,-247.07"/>
-</g>
-<!-- TUPLE_BOT -->
-<g id="node28" class="node">
-<title>TUPLE_BOT</title>
-<ellipse fill="pink" stroke="black" cx="1420.51" cy="-104.75" rx="42.65" ry="18"/>
-<text text-anchor="start" x="1397.26" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="1413.01" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:tuple</text>
-</g>
-<!-- TUPLE_BOT->BOT -->
-<g id="edge54" class="edge">
-<title>TUPLE_BOT->BOT</title>
-<path fill="none" stroke="black" d="M1379.42,-99.5C1240.27,-85.13 788.44,-38.44 663.04,-25.49"/>
-<polygon fill="black" stroke="black" points="663.44,-22.01 653.13,-24.46 662.72,-28.97 663.44,-22.01"/>
-</g>
-<!-- TUPLE1->TUPLE_BOT -->
-<g id="edge51" class="edge">
-<title>TUPLE1->TUPLE_BOT</title>
-<path fill="none" stroke="black" d="M1383.64,-189.85C1391.12,-172.8 1400.96,-150.34 1408.59,-132.93"/>
-<polygon fill="black" stroke="black" points="1411.61,-134.78 1412.41,-124.21 1405.19,-131.97 1411.61,-134.78"/>
-</g>
-<!-- TUPLE2->TUPLE_BOT -->
-<g id="edge52" class="edge">
-<title>TUPLE2->TUPLE_BOT</title>
-<path fill="none" stroke="black" d="M1453.19,-178.79C1446.51,-163.86 1438.92,-146.89 1432.73,-133.07"/>
-<polygon fill="black" stroke="black" points="1436.02,-131.83 1428.74,-124.13 1429.63,-134.69 1436.02,-131.83"/>
-</g>
-<!-- TUPLEN->TUPLE_BOT -->
-<g id="edge53" class="edge">
-<title>TUPLEN->TUPLE_BOT</title>
-<path fill="none" stroke="black" d="M1539.73,-195.16C1514.22,-176.03 1475.9,-147.29 1449.64,-127.59"/>
-<polygon fill="black" stroke="black" points="1451.86,-124.89 1441.76,-121.69 1447.66,-130.49 1451.86,-124.89"/>
-</g>
-</g>
-</svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Generated by graphviz version 12.2.0 (20241103.1931) + --> +<!-- Title: Lattice Pages: 1 --> +<svg width="2357pt" height="533pt" + viewBox="0.00 0.00 2357.00 533.45" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 529.45)"> +<title>Lattice</title> +<polygon fill="white" stroke="none" points="-4,4 -4,-529.45 2353,-529.45 2353,4 -4,4"/> +<g id="clust1" class="cluster"> +<title>cluster_control</title> +<polygon fill="none" stroke="#cccccc" points="8,-85.99 8,-454.71 98,-454.71 98,-85.99 8,-85.99"/> +<text text-anchor="middle" x="53" y="-437.41" font-family="Arial" font-size="14.00">Control</text> +</g> +<g id="clust2" class="cluster"> +<title>cluster_integer</title> +<polygon fill="none" stroke="#cccccc" points="106,-85.99 106,-454.71 404,-454.71 404,-85.99 106,-85.99"/> +<text text-anchor="middle" x="255" y="-437.41" font-family="Arial" font-size="14.00">Integer</text> +</g> +<g id="clust6" class="cluster"> +<title>cluster_float</title> +<polygon fill="none" stroke="#cccccc" points="412,-85.99 412,-454.71 942,-454.71 942,-85.99 412,-85.99"/> +<text text-anchor="middle" x="677" y="-437.41" font-family="Arial" font-size="14.00">Float</text> +</g> +<g id="clust8" class="cluster"> +<title>cluster_pointer</title> +<polygon fill="none" stroke="#cccccc" points="950,-75 950,-465.7 1431,-465.7 1431,-75 950,-75"/> +<text text-anchor="middle" x="1190.5" y="-448.4" font-family="Arial" font-size="14.00">Pointer = nullability × struct type</text> +</g> +<g id="clust15" class="cluster"> +<title>cluster_struct</title> +<polygon fill="none" stroke="#cccccc" points="1439,-75 1439,-481.45 1767,-481.45 1767,-75 1439,-75"/> +<text text-anchor="middle" x="1603" y="-464.15" font-family="Arial" font-size="14.00">Struct</text> +<text text-anchor="middle" x="1603" y="-448.4" font-family="Arial" font-size="14.00">named collection of named scalar types</text> +</g> +<g id="clust19" class="cluster"> +<title>cluster_memory</title> +<polygon fill="none" stroke="#cccccc" points="1775,-85.99 1775,-470.46 2057,-470.46 2057,-85.99 1775,-85.99"/> +<text text-anchor="middle" x="1916" y="-453.16" font-family="Arial" font-size="14.00">Memory</text> +<text text-anchor="middle" x="1916" y="-437.41" font-family="Arial" font-size="14.00">precise alias slices</text> +</g> +<g id="clust23" class="cluster"> +<title>cluster_tuple</title> +<polygon fill="none" stroke="#cccccc" points="2065,-85.99 2065,-470.46 2341,-470.46 2341,-85.99 2065,-85.99"/> +<text text-anchor="middle" x="2203" y="-453.16" font-family="Arial" font-size="14.00">Tuple</text> +<text text-anchor="middle" x="2203" y="-437.41" font-family="Arial" font-size="14.00">collection of types</text> +</g> +<!-- TOP --> +<g id="node1" class="node"> +<title>TOP</title> +<ellipse fill="black" stroke="black" cx="1171" cy="-507.45" rx="27" ry="18"/> +<text text-anchor="middle" x="1171" y="-503.35" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤</text> +</g> +<!-- XCTRL --> +<g id="node3" class="node"> +<title>XCTRL</title> +<ellipse fill="#ffff00" stroke="black" cx="53" cy="-404.96" rx="36.51" ry="18"/> +<text text-anchor="middle" x="53" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:ctrl</text> +</g> +<!-- TOP->XCTRL --> +<g id="edge68" class="edge"> +<title>TOP->XCTRL</title> +<path fill="none" stroke="#555555" d="M1143.75,-506.53C981.55,-506.91 148.8,-507.58 102,-481.45 82.13,-470.35 69.01,-447.44 61.39,-429.76"/> +<polygon fill="#555555" stroke="#555555" points="63.42,-429.19 59.21,-424.43 59.54,-430.78 63.42,-429.19"/> +</g> +<!-- INT_TOP --> +<g id="node5" class="node"> +<title>INT_TOP</title> +<ellipse fill="#add8e6" stroke="black" cx="353" cy="-404.96" rx="33.44" ry="18"/> +<text text-anchor="middle" x="353" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:int</text> +</g> +<!-- TOP->INT_TOP --> +<g id="edge69" class="edge"> +<title>TOP->INT_TOP</title> +<path fill="none" stroke="#555555" d="M1143.82,-506.22C1011.67,-505.05 441.13,-498.99 408,-481.45 387.13,-470.4 372.2,-447.48 363.21,-429.78"/> +<polygon fill="#555555" stroke="#555555" points="365.11,-428.89 360.61,-424.41 361.33,-430.72 365.11,-428.89"/> +</g> +<!-- FLT_TOP --> +<g id="node10" class="node"> +<title>FLT_TOP</title> +<ellipse fill="aqua" stroke="black" cx="755" cy="-404.96" rx="31.39" ry="18"/> +<text text-anchor="start" x="740" y="-401.86" font-family="DejaVu Sans" font-weight="bold" font-size="13.00">⊤</text> +<text text-anchor="start" x="752" y="-401.86" font-family="DejaVu Sans" font-size="13.00">:flt</text> +</g> +<!-- TOP->FLT_TOP --> +<g id="edge70" class="edge"> +<title>TOP->FLT_TOP</title> +<path fill="none" stroke="#555555" d="M1143.92,-505.75C1101.25,-504.14 1015.99,-498.84 946,-481.45 886.87,-466.76 821.59,-438.05 784.7,-420.58"/> +<polygon fill="#555555" stroke="#555555" points="785.84,-418.79 779.52,-418.1 784.03,-422.58 785.84,-418.79"/> +</g> +<!-- PTR_TOP --> +<g id="node15" class="node"> +<title>PTR_TOP</title> +<ellipse fill="#008000" stroke="black" cx="1171" cy="-404.96" rx="61.7" ry="28.99"/> +<text text-anchor="middle" x="1171" y="-409.11" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:ptr</text> +<text text-anchor="middle" x="1171" y="-392.61" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊤:struct]</text> +</g> +<!-- TOP->PTR_TOP --> +<g id="edge71" class="edge"> +<title>TOP->PTR_TOP</title> +<path fill="none" stroke="#555555" d="M1171,-489.4C1171,-476.29 1171,-457.72 1171,-441.43"/> +<polygon fill="#555555" stroke="#555555" points="1173.1,-441.64 1171,-435.64 1168.9,-441.64 1173.1,-441.64"/> +</g> +<!-- STRUCT_TOP --> +<g id="node25" class="node"> +<title>STRUCT_TOP</title> +<ellipse fill="#90ee90" stroke="black" cx="1558" cy="-404.96" rx="64.35" ry="28.99"/> +<text text-anchor="middle" x="1558" y="-409.11" font-family="DejaVu Sans" font-size="13.00">⊤:struct</text> +<text text-anchor="middle" x="1558" y="-392.61" font-family="DejaVu Sans" font-size="13.00">[struct top]</text> +</g> +<!-- TOP->STRUCT_TOP --> +<g id="edge72" class="edge"> +<title>TOP->STRUCT_TOP</title> +<path fill="none" stroke="#555555" d="M1197.97,-505.44C1256.13,-503.02 1391.55,-495.96 1435,-481.45 1466.2,-471.03 1497.74,-451.44 1521.07,-434.83"/> +<polygon fill="#555555" stroke="#555555" points="1522.26,-436.56 1525.9,-431.35 1519.8,-433.16 1522.26,-436.56"/> +</g> +<!-- MEM_TOP --> +<g id="node31" class="node"> +<title>MEM_TOP</title> +<ellipse fill="#00008b" stroke="black" cx="1881" cy="-404.96" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1881" y="-400.86" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:mem</text> +</g> +<!-- TOP->MEM_TOP --> +<g id="edge73" class="edge"> +<title>TOP->MEM_TOP</title> +<path fill="none" stroke="#555555" d="M1198.14,-506.2C1307.98,-505.07 1716.29,-499.67 1771,-481.45 1804.95,-470.14 1837.98,-444.99 1858.84,-426.82"/> +<polygon fill="#555555" stroke="#555555" points="1860.16,-428.46 1863.26,-422.9 1857.37,-425.31 1860.16,-428.46"/> +</g> +<!-- TUPLE_TOP --> +<g id="node36" class="node"> +<title>TUPLE_TOP</title> +<ellipse fill="#ffc0cb" stroke="black" cx="2118" cy="-404.96" rx="44.7" ry="18"/> +<text text-anchor="middle" x="2118" y="-400.86" font-family="DejaVu Sans" font-size="13.00">⊤:tuple</text> +</g> +<!-- TOP->TUPLE_TOP --> +<g id="edge74" class="edge"> +<title>TOP->TUPLE_TOP</title> +<path fill="none" stroke="#555555" d="M1198.25,-506.35C1343.51,-505.71 2021.76,-501.68 2061,-481.45 2082.45,-470.39 2098.06,-447.15 2107.46,-429.36"/> +<polygon fill="#555555" stroke="#555555" points="2109.12,-430.74 2109.96,-424.43 2105.37,-428.84 2109.12,-430.74"/> +</g> +<!-- BOT --> +<g id="node2" class="node"> +<title>BOT</title> +<ellipse fill="black" stroke="black" cx="1237" cy="-18" rx="27" ry="18"/> +<text text-anchor="middle" x="1237" y="-13.9" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥</text> +</g> +<!-- CTRL --> +<g id="node4" class="node"> +<title>CTRL</title> +<ellipse fill="#ffff00" stroke="black" cx="53" cy="-111.99" rx="36.51" ry="18"/> +<text text-anchor="middle" x="53" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:ctrl</text> +</g> +<!-- XCTRL->CTRL --> +<g id="edge1" class="edge"> +<title>XCTRL->CTRL</title> +<path fill="none" stroke="#555555" d="M53,-386.63C53,-337.1 53,-194.83 53,-137.43"/> +<polygon fill="#555555" stroke="#555555" points="55.1,-137.74 53,-131.74 50.9,-137.74 55.1,-137.74"/> +</g> +<!-- XCTRL->INT_TOP --> +<!-- CTRL->BOT --> +<g id="edge75" class="edge"> +<title>CTRL->BOT</title> +<path fill="none" stroke="#555555" d="M68.81,-95.65C77.79,-87.96 89.67,-79.38 102,-75 207.84,-37.39 1023.53,-22.38 1202.4,-19.52"/> +<polygon fill="#555555" stroke="#555555" points="1202.23,-21.63 1208.2,-19.43 1202.17,-17.43 1202.23,-21.63"/> +</g> +<!-- INT_NEG --> +<g id="node7" class="node"> +<title>INT_NEG</title> +<ellipse fill="#add8e6" stroke="black" cx="169" cy="-216.97" rx="55.45" ry="18"/> +<text text-anchor="middle" x="169" y="-212.87" font-family="DejaVu Sans" font-size="13.00">… −2, −1</text> +</g> +<!-- INT_TOP->INT_NEG --> +<g id="edge4" class="edge"> +<title>INT_TOP->INT_NEG</title> +<path fill="none" stroke="#555555" d="M337.94,-388.74C305.38,-355.83 228.33,-277.94 190.59,-239.8"/> +<polygon fill="#555555" stroke="#555555" points="192.09,-238.33 186.38,-235.54 189.11,-241.28 192.09,-238.33"/> +</g> +<!-- INT_ZERO --> +<g id="node8" class="node"> +<title>INT_ZERO</title> +<ellipse fill="#add8e6" stroke="black" cx="267" cy="-216.97" rx="27" ry="18"/> +<text text-anchor="middle" x="267" y="-212.87" font-family="DejaVu Sans" font-size="13.00">0</text> +</g> +<!-- INT_TOP->INT_ZERO --> +<g id="edge5" class="edge"> +<title>INT_TOP->INT_ZERO</title> +<path fill="none" stroke="#555555" d="M345.22,-387.12C329.8,-353.79 295.37,-279.32 277.78,-241.29"/> +<polygon fill="#555555" stroke="#555555" points="279.76,-240.57 275.34,-236.01 275.95,-242.34 279.76,-240.57"/> +</g> +<!-- INT_POS --> +<g id="node9" class="node"> +<title>INT_POS</title> +<ellipse fill="#add8e6" stroke="black" cx="353" cy="-216.97" rx="43.16" ry="18"/> +<text text-anchor="middle" x="353" y="-212.87" font-family="DejaVu Sans" font-size="13.00">1, 2, …</text> +</g> +<!-- INT_TOP->INT_POS --> +<g id="edge6" class="edge"> +<title>INT_TOP->INT_POS</title> +<path fill="none" stroke="#555555" d="M353,-386.46C353,-353.14 353,-280.53 353,-242.43"/> +<polygon fill="#555555" stroke="#555555" points="355.1,-242.8 353,-236.8 350.9,-242.8 355.1,-242.8"/> +</g> +<!-- INT_TOP->FLT_TOP --> +<!-- INT_BOT --> +<g id="node6" class="node"> +<title>INT_BOT</title> +<ellipse fill="#add8e6" stroke="black" cx="310" cy="-111.99" rx="33.44" ry="18"/> +<text text-anchor="middle" x="310" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:int</text> +</g> +<!-- INT_BOT->BOT --> +<g id="edge76" class="edge"> +<title>INT_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M334.8,-99.65C354.27,-91.29 382.29,-80.47 408,-75 563.61,-41.88 1066.53,-24.26 1202.72,-20.02"/> +<polygon fill="#555555" stroke="#555555" points="1202.6,-22.12 1208.53,-19.84 1202.47,-17.92 1202.6,-22.12"/> +</g> +<!-- INT_NEG->INT_BOT --> +<g id="edge7" class="edge"> +<title>INT_NEG->INT_BOT</title> +<path fill="none" stroke="#555555" d="M190.72,-200.11C216.15,-181.54 258.17,-150.85 284.95,-131.29"/> +<polygon fill="#555555" stroke="#555555" points="285.92,-133.18 289.52,-127.95 283.44,-129.79 285.92,-133.18"/> +</g> +<!-- INT_NEG->INT_ZERO --> +<!-- INT_ZERO->INT_BOT --> +<g id="edge8" class="edge"> +<title>INT_ZERO->INT_BOT</title> +<path fill="none" stroke="#555555" d="M273.91,-199.43C281.01,-182.41 292.14,-155.76 300.16,-136.55"/> +<polygon fill="#555555" stroke="#555555" points="302.01,-137.58 302.38,-131.24 298.13,-135.96 302.01,-137.58"/> +</g> +<!-- INT_ZERO->INT_POS --> +<!-- INT_POS->INT_BOT --> +<g id="edge9" class="edge"> +<title>INT_POS->INT_BOT</title> +<path fill="none" stroke="#555555" d="M345.9,-198.97C338.83,-182.05 327.93,-155.94 319.99,-136.93"/> +<polygon fill="#555555" stroke="#555555" points="321.94,-136.15 317.69,-131.42 318.07,-137.76 321.94,-136.15"/> +</g> +<!-- FLT_MINDOTS --> +<g id="node12" class="node"> +<title>FLT_MINDOTS</title> +<ellipse fill="aqua" stroke="black" cx="529" cy="-310.97" rx="109.19" ry="18"/> +<text text-anchor="middle" x="529" y="-306.87" font-family="DejaVu Sans" font-size="13.00">… negative constants</text> +</g> +<!-- FLT_TOP->FLT_MINDOTS --> +<g id="edge10" class="edge"> +<title>FLT_TOP->FLT_MINDOTS</title> +<path fill="none" stroke="#555555" d="M729.95,-393.76C692.71,-378.6 622.11,-349.86 575.3,-330.81"/> +<polygon fill="#555555" stroke="#555555" points="576.32,-328.96 569.97,-328.64 574.74,-332.85 576.32,-328.96"/> +</g> +<!-- FLT_ZERO --> +<g id="node13" class="node"> +<title>FLT_ZERO</title> +<ellipse fill="aqua" stroke="black" cx="681" cy="-310.97" rx="27" ry="18"/> +<text text-anchor="middle" x="681" y="-306.87" font-family="DejaVu Sans" font-size="13.00">0.0</text> +</g> +<!-- FLT_TOP->FLT_ZERO --> +<g id="edge11" class="edge"> +<title>FLT_TOP->FLT_ZERO</title> +<path fill="none" stroke="#555555" d="M742.45,-388.35C730.15,-373.06 711.32,-349.66 697.75,-332.79"/> +<polygon fill="#555555" stroke="#555555" points="699.71,-331.88 694.32,-328.52 696.44,-334.51 699.71,-331.88"/> +</g> +<!-- FLT_MAXDOTS --> +<g id="node14" class="node"> +<title>FLT_MAXDOTS</title> +<ellipse fill="aqua" stroke="black" cx="829" cy="-310.97" rx="105.09" ry="18"/> +<text text-anchor="middle" x="829" y="-306.87" font-family="DejaVu Sans" font-size="13.00">positive constants …</text> +</g> +<!-- FLT_TOP->FLT_MAXDOTS --> +<g id="edge12" class="edge"> +<title>FLT_TOP->FLT_MAXDOTS</title> +<path fill="none" stroke="#555555" d="M767.55,-388.35C779.41,-373.61 797.32,-351.34 810.76,-334.64"/> +<polygon fill="#555555" stroke="#555555" points="812.05,-336.39 814.18,-330.39 808.78,-333.75 812.05,-336.39"/> +</g> +<!-- FLT_TOP->PTR_TOP --> +<!-- FLT_BOT --> +<g id="node11" class="node"> +<title>FLT_BOT</title> +<ellipse fill="aqua" stroke="black" cx="718" cy="-111.99" rx="31.39" ry="18"/> +<text text-anchor="start" x="703" y="-108.89" font-family="DejaVu Sans" font-weight="bold" font-size="13.00">⊥</text> +<text text-anchor="start" x="715" y="-108.89" font-family="DejaVu Sans" font-size="13.00">:flt</text> +</g> +<!-- FLT_BOT->BOT --> +<g id="edge77" class="edge"> +<title>FLT_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M747.77,-105.72C838.15,-89.69 1109.02,-41.68 1203.8,-24.88"/> +<polygon fill="#555555" stroke="#555555" points="1204.08,-26.97 1209.62,-23.85 1203.35,-22.83 1204.08,-26.97"/> +</g> +<!-- FLT_MINDOTS->FLT_BOT --> +<g id="edge13" class="edge"> +<title>FLT_MINDOTS->FLT_BOT</title> +<path fill="none" stroke="#555555" d="M545.44,-292.83C580.25,-256.55 661.25,-172.14 698.55,-133.26"/> +<polygon fill="#555555" stroke="#555555" points="699.62,-135.18 702.26,-129.4 696.59,-132.27 699.62,-135.18"/> +</g> +<!-- FLT_MINDOTS->FLT_ZERO --> +<!-- FLT_ZERO->FLT_BOT --> +<g id="edge14" class="edge"> +<title>FLT_ZERO->FLT_BOT</title> +<path fill="none" stroke="#555555" d="M684.22,-292.83C690.79,-257.83 705.78,-178.04 713.39,-137.55"/> +<polygon fill="#555555" stroke="#555555" points="715.44,-138 714.48,-131.72 711.31,-137.22 715.44,-138"/> +</g> +<!-- FLT_ZERO->FLT_MAXDOTS --> +<!-- FLT_MAXDOTS->FLT_BOT --> +<g id="edge15" class="edge"> +<title>FLT_MAXDOTS->FLT_BOT</title> +<path fill="none" stroke="#555555" d="M819.34,-292.83C799.4,-257.44 753.64,-176.23 731.07,-136.19"/> +<polygon fill="#555555" stroke="#555555" points="732.92,-135.18 728.14,-130.99 729.26,-137.25 732.92,-135.18"/> +</g> +<!-- PTR_NULL --> +<g id="node17" class="node"> +<title>PTR_NULL</title> +<ellipse fill="#008000" stroke="black" cx="1297" cy="-310.97" rx="27.3" ry="18"/> +<text text-anchor="middle" x="1297" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">null</text> +</g> +<!-- PTR_TOP->PTR_NULL --> +<g id="edge24" class="edge"> +<title>PTR_TOP->PTR_NULL</title> +<path fill="none" stroke="#555555" d="M1203.78,-380.03C1225.49,-364.18 1253.48,-343.74 1273.1,-329.42"/> +<polygon fill="#555555" stroke="#555555" points="1274.33,-331.12 1277.93,-325.88 1271.85,-327.73 1274.33,-331.12"/> +</g> +<!-- PTR_PERSON --> +<g id="node19" class="node"> +<title>PTR_PERSON</title> +<ellipse fill="#008000" stroke="black" cx="1040" cy="-310.97" rx="45.72" ry="18"/> +<text text-anchor="middle" x="1040" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*Person</text> +</g> +<!-- PTR_TOP->PTR_PERSON --> +<g id="edge25" class="edge"> +<title>PTR_TOP->PTR_PERSON</title> +<path fill="none" stroke="#555555" d="M1137.26,-380.27C1115.69,-365.12 1088.05,-345.71 1067.76,-331.46"/> +<polygon fill="#555555" stroke="#555555" points="1069.06,-329.81 1062.95,-328.08 1066.65,-333.25 1069.06,-329.81"/> +</g> +<!-- PTR_S1 --> +<g id="node20" class="node"> +<title>PTR_S1</title> +<ellipse fill="#008000" stroke="black" cx="1129" cy="-310.97" rx="27" ry="18"/> +<text text-anchor="middle" x="1129" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*s1</text> +</g> +<!-- PTR_TOP->PTR_S1 --> +<g id="edge26" class="edge"> +<title>PTR_TOP->PTR_S1</title> +<path fill="none" stroke="#555555" d="M1158.4,-376.36C1152.4,-363.23 1145.32,-347.71 1139.6,-335.19"/> +<polygon fill="#555555" stroke="#555555" points="1141.62,-334.55 1137.22,-329.96 1137.8,-336.29 1141.62,-334.55"/> +</g> +<!-- PTR_MORE --> +<g id="node21" class="node"> +<title>PTR_MORE</title> +<ellipse fill="#008000" stroke="black" cx="1213" cy="-310.97" rx="40.6" ry="18"/> +<text text-anchor="middle" x="1213" y="-306.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*s2, …</text> +</g> +<!-- PTR_TOP->PTR_MORE --> +<g id="edge27" class="edge"> +<title>PTR_TOP->PTR_MORE</title> +<path fill="none" stroke="#555555" d="M1183.6,-376.36C1189.55,-363.32 1196.59,-347.92 1202.28,-335.45"/> +<polygon fill="#555555" stroke="#555555" points="1204.08,-336.56 1204.66,-330.23 1200.26,-334.82 1204.08,-336.56"/> +</g> +<!-- PTR_TOP->STRUCT_TOP --> +<!-- PTR_BOT --> +<g id="node16" class="node"> +<title>PTR_BOT</title> +<ellipse fill="#008000" stroke="black" cx="1237" cy="-111.99" rx="66.47" ry="28.99"/> +<text text-anchor="middle" x="1237" y="-116.14" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥:ptr</text> +<text text-anchor="middle" x="1237" y="-99.64" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊥:struct?]</text> +</g> +<!-- PTR_BOT->BOT --> +<g id="edge78" class="edge"> +<title>PTR_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M1237,-82.64C1237,-70.25 1237,-55.86 1237,-43.89"/> +<polygon fill="#555555" stroke="#555555" points="1239.1,-43.94 1237,-37.94 1234.9,-43.94 1239.1,-43.94"/> +</g> +<!-- PTR_PERSON_NIL --> +<g id="node22" class="node"> +<title>PTR_PERSON_NIL</title> +<ellipse fill="#008000" stroke="black" cx="1189" cy="-216.97" rx="50.33" ry="18"/> +<text text-anchor="middle" x="1189" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*Person?</text> +</g> +<!-- PTR_NULL->PTR_PERSON_NIL --> +<g id="edge34" class="edge"> +<title>PTR_NULL->PTR_PERSON_NIL</title> +<path fill="none" stroke="#555555" d="M1281.06,-296.39C1263.26,-281.22 1234.22,-256.49 1213.51,-238.85"/> +<polygon fill="#555555" stroke="#555555" points="1214.99,-237.36 1209.06,-235.06 1212.27,-240.55 1214.99,-237.36"/> +</g> +<!-- PTR_S1_NIL --> +<g id="node23" class="node"> +<title>PTR_S1_NIL</title> +<ellipse fill="#008000" stroke="black" cx="1286" cy="-216.97" rx="30.37" ry="18"/> +<text text-anchor="middle" x="1286" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*s1?</text> +</g> +<!-- PTR_NULL->PTR_S1_NIL --> +<g id="edge35" class="edge"> +<title>PTR_NULL->PTR_S1_NIL</title> +<path fill="none" stroke="#555555" d="M1294.93,-292.66C1293.24,-278.53 1290.83,-258.38 1288.94,-242.57"/> +<polygon fill="#555555" stroke="#555555" points="1291.04,-242.41 1288.24,-236.7 1286.87,-242.91 1291.04,-242.41"/> +</g> +<!-- PTR_MORE_NIL --> +<g id="node24" class="node"> +<title>PTR_MORE_NIL</title> +<ellipse fill="#008000" stroke="black" cx="1378" cy="-216.97" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1378" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">*s2?, …</text> +</g> +<!-- PTR_NULL->PTR_MORE_NIL --> +<g id="edge36" class="edge"> +<title>PTR_NULL->PTR_MORE_NIL</title> +<path fill="none" stroke="#555555" d="M1310.38,-294.78C1323.54,-279.83 1343.77,-256.85 1358.68,-239.92"/> +<polygon fill="#555555" stroke="#555555" points="1360.12,-241.46 1362.51,-235.57 1356.97,-238.68 1360.12,-241.46"/> +</g> +<!-- PTR_ANY --> +<g id="node18" class="node"> +<title>PTR_ANY</title> +<ellipse fill="#008000" stroke="black" cx="1040" cy="-216.97" rx="82.38" ry="28.99"/> +<text text-anchor="middle" x="1040" y="-221.12" font-family="DejaVu Sans" font-size="13.00" fill="white">*⊥:struct</text> +<text text-anchor="middle" x="1040" y="-204.62" font-family="DejaVu Sans" font-size="13.00" fill="white">[ptr any struct]</text> +</g> +<!-- PTR_ANY->PTR_BOT --> +<g id="edge37" class="edge"> +<title>PTR_ANY->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1085.2,-192.35C1116.06,-176.21 1156.91,-154.86 1188.46,-138.37"/> +<polygon fill="#555555" stroke="#555555" points="1189.36,-140.27 1193.7,-135.63 1187.41,-136.54 1189.36,-140.27"/> +</g> +<!-- PTR_ANY->PTR_PERSON_NIL --> +<!-- PTR_PERSON->PTR_ANY --> +<g id="edge28" class="edge"> +<title>PTR_PERSON->PTR_ANY</title> +<path fill="none" stroke="#555555" d="M1040,-292.66C1040,-281.68 1040,-267.07 1040,-253.69"/> +<polygon fill="#555555" stroke="#555555" points="1042.1,-253.92 1040,-247.92 1037.9,-253.92 1042.1,-253.92"/> +</g> +<!-- PTR_PERSON->PTR_S1 --> +<!-- PTR_PERSON->PTR_PERSON_NIL --> +<g id="edge31" class="edge"> +<title>PTR_PERSON->PTR_PERSON_NIL</title> +<path fill="none" stroke="#555555" d="M1063.94,-295.19C1089.64,-279.32 1130.53,-254.07 1158.51,-236.8"/> +<polygon fill="#555555" stroke="#555555" points="1159.33,-238.76 1163.34,-233.82 1157.13,-235.18 1159.33,-238.76"/> +</g> +<!-- PTR_S1->PTR_ANY --> +<g id="edge29" class="edge"> +<title>PTR_S1->PTR_ANY</title> +<path fill="none" stroke="#555555" d="M1114.7,-295.19C1102.96,-283.05 1085.9,-265.42 1071.05,-250.07"/> +<polygon fill="#555555" stroke="#555555" points="1072.84,-248.9 1067.16,-246.05 1069.83,-251.82 1072.84,-248.9"/> +</g> +<!-- PTR_S1->PTR_MORE --> +<!-- PTR_S1->PTR_S1_NIL --> +<g id="edge32" class="edge"> +<title>PTR_S1->PTR_S1_NIL</title> +<path fill="none" stroke="#555555" d="M1150.34,-299.41C1174.33,-287.32 1214.22,-266.51 1247,-245.97 1251.87,-242.92 1256.94,-239.48 1261.75,-236.09"/> +<polygon fill="#555555" stroke="#555555" points="1262.79,-237.93 1266.45,-232.73 1260.35,-234.51 1262.79,-237.93"/> +</g> +<!-- PTR_MORE->PTR_NULL --> +<!-- PTR_MORE->PTR_ANY --> +<g id="edge30" class="edge"> +<title>PTR_MORE->PTR_ANY</title> +<path fill="none" stroke="#555555" d="M1187.84,-296.59C1162.54,-283.13 1122.81,-262.01 1090.91,-245.04"/> +<polygon fill="#555555" stroke="#555555" points="1092.26,-243.38 1085.97,-242.42 1090.28,-247.09 1092.26,-243.38"/> +</g> +<!-- PTR_MORE->PTR_MORE_NIL --> +<g id="edge33" class="edge"> +<title>PTR_MORE->PTR_MORE_NIL</title> +<path fill="none" stroke="#555555" d="M1237.7,-296.19C1266.57,-280.1 1314.43,-253.42 1346.09,-235.77"/> +<polygon fill="#555555" stroke="#555555" points="1347.05,-237.64 1351.26,-232.88 1345,-233.97 1347.05,-237.64"/> +</g> +<!-- PTR_PERSON_NIL->PTR_BOT --> +<g id="edge38" class="edge"> +<title>PTR_PERSON_NIL->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1196.93,-198.97C1203.41,-185.05 1212.8,-164.91 1220.86,-147.62"/> +<polygon fill="#555555" stroke="#555555" points="1222.72,-148.6 1223.35,-142.27 1218.91,-146.83 1222.72,-148.6"/> +</g> +<!-- PTR_PERSON_NIL->PTR_S1_NIL --> +<!-- PTR_S1_NIL->PTR_BOT --> +<g id="edge39" class="edge"> +<title>PTR_S1_NIL->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1278.13,-199.43C1271.43,-185.35 1261.59,-164.68 1253.22,-147.07"/> +<polygon fill="#555555" stroke="#555555" points="1255.33,-146.63 1250.86,-142.11 1251.54,-148.43 1255.33,-146.63"/> +</g> +<!-- PTR_S1_NIL->PTR_MORE_NIL --> +<!-- PTR_MORE_NIL->PTR_BOT --> +<g id="edge40" class="edge"> +<title>PTR_MORE_NIL->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1357.19,-200.78C1335.97,-185.28 1302.52,-160.85 1276.3,-141.69"/> +<polygon fill="#555555" stroke="#555555" points="1277.78,-140.18 1271.7,-138.33 1275.31,-143.57 1277.78,-140.18"/> +</g> +<!-- STRUCT_PERSON --> +<g id="node27" class="node"> +<title>STRUCT_PERSON</title> +<polygon fill="#90ee90" stroke="black" points="1514.5,-237.47 1447.5,-237.47 1447.5,-196.47 1514.5,-196.47 1514.5,-237.47"/> +<text text-anchor="middle" x="1481" y="-221.12" font-family="DejaVu Sans" font-size="13.00">Person</text> +<text text-anchor="middle" x="1481" y="-204.62" font-family="DejaVu Sans" font-size="13.00">age: int</text> +</g> +<!-- STRUCT_TOP->STRUCT_PERSON --> +<g id="edge44" class="edge"> +<title>STRUCT_TOP->STRUCT_PERSON</title> +<path fill="none" stroke="#555555" d="M1546.47,-376.11C1531.72,-340.49 1506.36,-279.23 1491.91,-244.33"/> +<polygon fill="#555555" stroke="#555555" points="1493.99,-243.86 1489.75,-239.12 1490.11,-245.47 1493.99,-243.86"/> +</g> +<!-- STRUCT_S1 --> +<g id="node28" class="node"> +<title>STRUCT_S1</title> +<polygon fill="#90ee90" stroke="black" points="1585,-237.47 1531,-237.47 1531,-196.47 1585,-196.47 1585,-237.47"/> +<text text-anchor="middle" x="1558" y="-221.12" font-family="DejaVu Sans" font-size="13.00">s1</text> +<text text-anchor="middle" x="1558" y="-204.62" font-family="DejaVu Sans" font-size="13.00">x: int</text> +</g> +<!-- STRUCT_TOP->STRUCT_S1 --> +<g id="edge45" class="edge"> +<title>STRUCT_TOP->STRUCT_S1</title> +<path fill="none" stroke="#555555" d="M1558,-375.71C1558,-340.38 1558,-280.29 1558,-245.36"/> +<polygon fill="#555555" stroke="#555555" points="1560.1,-245.4 1558,-239.4 1555.9,-245.4 1560.1,-245.4"/> +</g> +<!-- STRUCT_S2 --> +<g id="node29" class="node"> +<title>STRUCT_S2</title> +<polygon fill="#90ee90" stroke="black" points="1689,-237.47 1601,-237.47 1601,-196.47 1689,-196.47 1689,-237.47"/> +<text text-anchor="middle" x="1645" y="-221.12" font-family="DejaVu Sans" font-size="13.00">s2</text> +<text text-anchor="middle" x="1645" y="-204.62" font-family="DejaVu Sans" font-size="13.00">x: int, y: flt</text> +</g> +<!-- STRUCT_TOP->STRUCT_S2 --> +<g id="edge46" class="edge"> +<title>STRUCT_TOP->STRUCT_S2</title> +<path fill="none" stroke="#555555" d="M1571.02,-376.11C1587.69,-340.49 1616.35,-279.23 1632.67,-244.33"/> +<polygon fill="#555555" stroke="#555555" points="1634.48,-245.42 1635.12,-239.09 1630.68,-243.64 1634.48,-245.42"/> +</g> +<!-- STRUCT_MORE --> +<g id="node30" class="node"> +<title>STRUCT_MORE</title> +<polygon fill="#90ee90" stroke="black" points="1759,-234.97 1705,-234.97 1705,-198.97 1759,-198.97 1759,-234.97"/> +<text text-anchor="middle" x="1732" y="-212.87" font-family="DejaVu Sans" font-size="13.00">…</text> +</g> +<!-- STRUCT_TOP->STRUCT_MORE --> +<g id="edge47" class="edge"> +<title>STRUCT_TOP->STRUCT_MORE</title> +<path fill="none" stroke="#555555" d="M1582.56,-377.7C1616.8,-341.11 1678.29,-275.38 1710.69,-240.75"/> +<polygon fill="#555555" stroke="#555555" points="1712.04,-242.39 1714.6,-236.57 1708.97,-239.52 1712.04,-242.39"/> +</g> +<!-- STRUCT_TOP->MEM_TOP --> +<!-- STRUCT_BOT --> +<g id="node26" class="node"> +<title>STRUCT_BOT</title> +<ellipse fill="#90ee90" stroke="black" cx="1558" cy="-111.99" rx="82.91" ry="28.99"/> +<text text-anchor="middle" x="1558" y="-116.14" font-family="DejaVu Sans" font-size="13.00">⊥:struct</text> +<text text-anchor="middle" x="1558" y="-99.64" font-family="DejaVu Sans" font-size="13.00">[struct bottom]</text> +</g> +<!-- STRUCT_BOT->BOT --> +<g id="edge79" class="edge"> +<title>STRUCT_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M1495.46,-92.57C1476.09,-86.9 1454.67,-80.66 1435,-75 1376.34,-58.12 1307.78,-38.83 1268.67,-27.86"/> +<polygon fill="#555555" stroke="#555555" points="1269.52,-25.92 1263.17,-26.32 1268.38,-29.96 1269.52,-25.92"/> +</g> +<!-- STRUCT_PERSON->STRUCT_BOT --> +<g id="edge48" class="edge"> +<title>STRUCT_PERSON->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1495.85,-196.12C1506.43,-181.96 1520.92,-162.59 1533.24,-146.11"/> +<polygon fill="#555555" stroke="#555555" points="1534.85,-147.46 1536.76,-141.4 1531.49,-144.94 1534.85,-147.46"/> +</g> +<!-- STRUCT_PERSON->STRUCT_S1 --> +<!-- STRUCT_S1->STRUCT_BOT --> +<g id="edge49" class="edge"> +<title>STRUCT_S1->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1558,-196.12C1558,-182.64 1558,-164.43 1558,-148.49"/> +<polygon fill="#555555" stroke="#555555" points="1560.1,-148.87 1558,-142.87 1555.9,-148.87 1560.1,-148.87"/> +</g> +<!-- STRUCT_S1->STRUCT_S2 --> +<!-- STRUCT_S2->STRUCT_BOT --> +<g id="edge50" class="edge"> +<title>STRUCT_S2->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1628.23,-196.12C1616.16,-181.83 1599.61,-162.25 1585.61,-145.68"/> +<polygon fill="#555555" stroke="#555555" points="1587.43,-144.57 1581.95,-141.34 1584.22,-147.28 1587.43,-144.57"/> +</g> +<!-- STRUCT_S2->STRUCT_MORE --> +<!-- STRUCT_MORE->STRUCT_BOT --> +<g id="edge51" class="edge"> +<title>STRUCT_MORE->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1711.74,-198.76C1707.02,-195.04 1701.93,-191.25 1697,-187.98 1670.12,-170.19 1638.63,-152.93 1612.41,-139.46"/> +<polygon fill="#555555" stroke="#555555" points="1613.52,-137.67 1607.22,-136.81 1611.61,-141.41 1613.52,-137.67"/> +</g> +<!-- MEM_ALIAS2 --> +<g id="node33" class="node"> +<title>MEM_ALIAS2</title> +<ellipse fill="#00008b" stroke="black" cx="1828" cy="-216.97" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1828" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#2</text> +</g> +<!-- MEM_TOP->MEM_ALIAS2 --> +<g id="edge54" class="edge"> +<title>MEM_TOP->MEM_ALIAS2</title> +<path fill="none" stroke="#555555" d="M1876.11,-386.79C1866.64,-353.58 1845.8,-280.42 1834.92,-242.24"/> +<polygon fill="#555555" stroke="#555555" points="1836.96,-241.75 1833.29,-236.55 1832.92,-242.9 1836.96,-241.75"/> +</g> +<!-- MEM_ALIAS3 --> +<g id="node34" class="node"> +<title>MEM_ALIAS3</title> +<ellipse fill="#00008b" stroke="black" cx="1934" cy="-216.97" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1934" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#3</text> +</g> +<!-- MEM_TOP->MEM_ALIAS3 --> +<g id="edge55" class="edge"> +<title>MEM_TOP->MEM_ALIAS3</title> +<path fill="none" stroke="#555555" d="M1885.89,-386.79C1895.36,-353.58 1916.2,-280.42 1927.08,-242.24"/> +<polygon fill="#555555" stroke="#555555" points="1929.08,-242.9 1928.71,-236.55 1925.04,-241.75 1929.08,-242.9"/> +</g> +<!-- MEM_MORE --> +<g id="node35" class="node"> +<title>MEM_MORE</title> +<ellipse fill="#00008b" stroke="black" cx="2022" cy="-216.97" rx="27" ry="18"/> +<text text-anchor="middle" x="2022" y="-212.87" font-family="DejaVu Sans" font-size="13.00" fill="white">…</text> +</g> +<!-- MEM_TOP->MEM_MORE --> +<g id="edge56" class="edge"> +<title>MEM_TOP->MEM_MORE</title> +<path fill="none" stroke="#555555" d="M1893.51,-387.45C1919.1,-353.7 1977.4,-276.8 2005.82,-239.32"/> +<polygon fill="#555555" stroke="#555555" points="2007.25,-240.91 2009.2,-234.86 2003.9,-238.37 2007.25,-240.91"/> +</g> +<!-- MEM_TOP->TUPLE_TOP --> +<!-- MEM_BOT --> +<g id="node32" class="node"> +<title>MEM_BOT</title> +<ellipse fill="#00008b" stroke="black" cx="1881" cy="-111.99" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1881" y="-107.89" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥:mem</text> +</g> +<!-- MEM_BOT->BOT --> +<g id="edge80" class="edge"> +<title>MEM_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M1849.72,-98.79C1827.96,-90.8 1798.12,-80.79 1771,-75 1585.39,-35.37 1357.24,-23.36 1271.62,-20.1"/> +<polygon fill="#555555" stroke="#555555" points="1271.85,-18 1265.78,-19.88 1271.7,-22.2 1271.85,-18"/> +</g> +<!-- MEM_ALIAS2->MEM_BOT --> +<g id="edge57" class="edge"> +<title>MEM_ALIAS2->MEM_BOT</title> +<path fill="none" stroke="#555555" d="M1836.75,-198.97C1845.5,-181.97 1859.02,-155.71 1868.81,-136.68"/> +<polygon fill="#555555" stroke="#555555" points="1870.66,-137.66 1871.54,-131.37 1866.93,-135.74 1870.66,-137.66"/> +</g> +<!-- MEM_ALIAS2->MEM_ALIAS3 --> +<!-- MEM_ALIAS3->MEM_BOT --> +<g id="edge58" class="edge"> +<title>MEM_ALIAS3->MEM_BOT</title> +<path fill="none" stroke="#555555" d="M1925.25,-198.97C1916.5,-181.97 1902.98,-155.71 1893.19,-136.68"/> +<polygon fill="#555555" stroke="#555555" points="1895.07,-135.74 1890.46,-131.37 1891.34,-137.66 1895.07,-135.74"/> +</g> +<!-- MEM_ALIAS3->MEM_MORE --> +<!-- MEM_MORE->MEM_BOT --> +<g id="edge59" class="edge"> +<title>MEM_MORE->MEM_BOT</title> +<path fill="none" stroke="#555555" d="M2005.42,-202.39C1999.65,-197.74 1993.09,-192.57 1987,-187.98 1960.93,-168.37 1930.47,-146.96 1908.9,-132.06"/> +<polygon fill="#555555" stroke="#555555" points="1910.17,-130.38 1904.03,-128.71 1907.78,-133.84 1910.17,-130.38"/> +</g> +<!-- TUPLE1 --> +<g id="node38" class="node"> +<title>TUPLE1</title> +<polygon fill="#ffc0cb" stroke="black" points="2128.88,-328.97 2073.12,-328.97 2073.12,-292.97 2128.88,-292.97 2128.88,-328.97"/> +<text text-anchor="middle" x="2101" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type)</text> +</g> +<!-- TUPLE_TOP->TUPLE1 --> +<g id="edge62" class="edge"> +<title>TUPLE_TOP->TUPLE1</title> +<path fill="none" stroke="#555555" d="M2114.8,-386.65C2112.19,-372.52 2108.47,-352.37 2105.54,-336.56"/> +<polygon fill="#555555" stroke="#555555" points="2107.61,-336.2 2104.46,-330.68 2103.48,-336.96 2107.61,-336.2"/> +</g> +<!-- TUPLE2 --> +<g id="node39" class="node"> +<title>TUPLE2</title> +<polygon fill="#ffc0cb" stroke="black" points="2239,-328.97 2145,-328.97 2145,-292.97 2239,-292.97 2239,-328.97"/> +<text text-anchor="middle" x="2192" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, type)</text> +</g> +<!-- TUPLE_TOP->TUPLE2 --> +<g id="edge63" class="edge"> +<title>TUPLE_TOP->TUPLE2</title> +<path fill="none" stroke="#555555" d="M2131.23,-387.51C2143,-372.87 2160.35,-351.31 2173.5,-334.97"/> +<polygon fill="#555555" stroke="#555555" points="2175.06,-336.38 2177.18,-330.39 2171.79,-333.74 2175.06,-336.38"/> +</g> +<!-- TUPLEN --> +<g id="node40" class="node"> +<title>TUPLEN</title> +<polygon fill="#ffc0cb" stroke="black" points="2332.75,-328.97 2255.25,-328.97 2255.25,-292.97 2332.75,-292.97 2332.75,-328.97"/> +<text text-anchor="middle" x="2294" y="-306.87" font-family="DejaVu Sans" font-size="13.00">(type, …)</text> +</g> +<!-- TUPLE_TOP->TUPLEN --> +<g id="edge64" class="edge"> +<title>TUPLE_TOP->TUPLEN</title> +<path fill="none" stroke="#555555" d="M2144.35,-390.18C2173.39,-375.01 2220.42,-350.42 2254.01,-332.87"/> +<polygon fill="#555555" stroke="#555555" points="2254.85,-334.8 2259.2,-330.16 2252.91,-331.07 2254.85,-334.8"/> +</g> +<!-- TUPLE_BOT --> +<g id="node37" class="node"> +<title>TUPLE_BOT</title> +<ellipse fill="#ffc0cb" stroke="black" cx="2155" cy="-111.99" rx="44.7" ry="18"/> +<text text-anchor="middle" x="2155" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:tuple</text> +</g> +<!-- TUPLE_BOT->BOT --> +<g id="edge81" class="edge"> +<title>TUPLE_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M2126.88,-97.69C2108.55,-89.66 2083.87,-80.04 2061,-75 1906.73,-41.03 1407.62,-24.05 1271.54,-19.98"/> +<polygon fill="#555555" stroke="#555555" points="1271.79,-17.89 1265.73,-19.81 1271.67,-22.08 1271.79,-17.89"/> +</g> +<!-- TUPLE1->TUPLE_BOT --> +<g id="edge65" class="edge"> +<title>TUPLE1->TUPLE_BOT</title> +<path fill="none" stroke="#555555" d="M2105.79,-292.49C2115.46,-257.21 2137.33,-177.44 2148.37,-137.19"/> +<polygon fill="#555555" stroke="#555555" points="2150.33,-137.95 2149.9,-131.61 2146.28,-136.84 2150.33,-137.95"/> +</g> +<!-- TUPLE1->TUPLE2 --> +<!-- TUPLE2->TUPLE_BOT --> +<g id="edge66" class="edge"> +<title>TUPLE2->TUPLE_BOT</title> +<path fill="none" stroke="#555555" d="M2188.72,-292.49C2182.12,-257.37 2167.24,-178.17 2159.65,-137.74"/> +<polygon fill="#555555" stroke="#555555" points="2161.73,-137.43 2158.56,-131.92 2157.6,-138.2 2161.73,-137.43"/> +</g> +<!-- TUPLE2->TUPLEN --> +<!-- TUPLEN->TUPLE_BOT --> +<g id="edge67" class="edge"> +<title>TUPLEN->TUPLE_BOT</title> +<path fill="none" stroke="#555555" d="M2281.66,-292.49C2256.44,-256.74 2198.97,-175.3 2170.95,-135.59"/> +<polygon fill="#555555" stroke="#555555" points="2172.76,-134.52 2167.59,-130.83 2169.33,-136.94 2172.76,-134.52"/> +</g> +</g> +</svg> diff --git a/chapter13/README.md b/chapter13/README.md index 1c492468..38b512cc 100644 --- a/chapter13/README.md +++ b/chapter13/README.md @@ -1,5 +1,8 @@ # Chapter 13: References +[Previous: Chapter 12](../chapter12/README.md) | +[Next: Chapter 14](../chapter14/README.md) + Memory retains one `$mem` binding and lazy partitions. Typed initialization stores now include each field's declared type and initialization flag, while `MemMerge` preserves the other fields. Start and Return keep control in slot 0 @@ -8,9 +11,9 @@ and memory in slot 1. # Table of Contents 1. [References](#references) - - [Forward References](#forward-references) - - [Self-referential references](#self-referential-references) - - [Auto deepen forward ref types](#auto-deepen-forward-ref-types) + - [Forward References](#forward-references) + - [Self-referential references](#self-referential-references) + - [Auto deepen forward ref types](#auto-deepen-forward-ref-types) 2. [Global Code Motion Example](#global-code-motion-walkthrough) In this chapter, we add references and structs. @@ -39,7 +42,7 @@ FamilyTree? tree; // A family tree, or not ... ``` At the time of the `Person` struct definition, the `FamilyTree` struct is not yet defined. This is a forward reference. To handle this, we assume the struct will be defined later. -```java +```java Type t = TYPES.get(tname); // Assume a forward-reference type if( t == null ) { @@ -55,7 +58,7 @@ Type t = TYPES.get(tname); ``` Reference fields start out as null, doing anything with them will result in a compile time error. -```java +```java struct Person { String name; int age; @@ -63,11 +66,11 @@ struct Person { } Person p = new Person; p.tree.la = null; // Accessing unknown field 'la' from 'null' - + ``` It turns out `p.tree` is `null`, so we can't access the field `la` from it. -```java +```java // name = "tree" // mem() is the current aggregate; its tree alias selects the initializing Store. // in(3) = {ConstantNode@1651} "null" @@ -76,7 +79,7 @@ return parsePostfix(new LoadNode(name, alias, declaredType.glb(), mem(), expr).p `LoadNode::idealize` LoadNode first selects its alias through any MemMerge, then returns `st.val()` when it finds a matching Store to the same object. -```java +```java // Simple Load-after-Store on same address. if( mem() instanceof StoreNode st && ptr() == st.ptr() && _alias == st._alias ) { // Same object and field @@ -115,8 +118,8 @@ private Node newStruct(TypeStruct obj) { ``` Zooming in.... -```java -// parsing = FamilyTree? tree; +```java +// parsing = FamilyTree? tree; for( Field field : obj._fields ) { // field._type = *FamilyTree? // REMEMBER: @@ -128,7 +131,7 @@ for( Field field : obj._fields ) { In a case of a reference `field._type.makeInit()` will return a `NULLPTR`, later this is what the peephole turns into when loading the field. `p.tree` ---- +--- ```java struct N { N next; int i; } @@ -137,16 +140,16 @@ return n.next; // Value reports as null, despite field typed as not-null ``` As shown above, we explicitly allow not-null fields to be null initialized (as -of chapter13). We can't allow null to be stored into a not-null field, but we +of Chapter 13). We can't allow null to be stored into a not-null field, but we can allow a not-null field to be null (initially). This will be corrected in a later chapter. ### Self-referential references -Self-cyclic or self-referential types are types that include a reference to themsleves as part of their defintion. +Self-cyclic or self-referential types are types that include a reference to themselves as part of their definition. Consider the following code: -```java +```java struct N { N next; int i; } N n = new N; n.next = null; // <<-- Compile error, cannot store null into not-null field @@ -163,13 +166,13 @@ When `a.next` is encountered, we auto deepen the type so its fields are going to This is needed to resolve the stale type that the loop brings around. -```java +```java if( e instanceof TypeMemPtr tmp && tmp._obj._fields==null ) { e = tmp.make_from((TypeStruct) TYPES.get(tmp._obj._name)); } -``` +``` -```java +```java struct LLI { LLI? next; int i; } LLI? head = null; while( arg ) { @@ -187,7 +190,7 @@ return next.i; --- -Normal field syntax works: +Normal field syntax works: e.g. `person.tree.father = new Person;` or `person.tree.father.name = "Dad";`. @@ -218,7 +221,7 @@ Now that we have all these new features covered consider the following example: struct Person { String name; int age; - FamilyTree? tree; + FamilyTree? tree; } Person p = new Person; p.age =1; @@ -244,7 +247,7 @@ From: $ctrl to: $ctrl|.age=(19) From: $ctrl to: $ctrl|.tree=(17) ``` The control nodes are already set so the early schedule is useless. -All the nodes involed: Return, Constant, NewNode specific their control input explicitly so there is nothing to do. +All the nodes involved: Return, Constant, NewNode specify their control input explicitly so there is nothing to do. #### Late schedule: ``` @@ -253,7 +256,7 @@ From: Start to: $ctrl(18) ``` We see that the late schedule actually changes the control input of the StartNode to the $ctrl node in 2 cases. The algo that does this is: -```java +```java // Walk up from the LCA to the early, looking for best place. This is // the lowest execution frequency, approximated by least loop depth and // deepest control flow. diff --git a/chapter14/README.md b/chapter14/README.md index acd8a492..a68baa5c 100644 --- a/chapter14/README.md +++ b/chapter14/README.md @@ -1,5 +1,8 @@ # Chapter 14: Narrow types +[Previous: Chapter 13](../chapter13/README.md) | +[Next: Chapter 15](../chapter15/README.md) + Memory retains the single `$mem` binding and lazy partitions from Chapter 10b. Narrow-field stores perform this chapter's truncation before updating their alias in MemMerge. Start and Return keep control in slot 0 and memory in slot 1. @@ -7,9 +10,9 @@ alias in MemMerge. Start and Return keep control in slot 0 and memory in slot 1. # Table of Contents 1. [Narrow Word Types](#narrow-or-sub-word-types) -2. [OverFlow handling](#overflow-handling) +2. [Overflow handling](#overflow-handling) 3. [Integer ranges](#integer-ranges) -4. [Bitwise operations](#examples) +4. [Bitwise operations](#bitwise-operations) 5. [Precedence](#precedence) 6. [Type lattice](#type-implementation) 7. [Nodes](#nodes) @@ -21,7 +24,7 @@ You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linea ## Narrow or sub-word types -Narrow or sub-worded integer types refer to integer data types that occupy less memory (fewer bits) than the standard or "full-width"(Typically 32, or 64 bits) integer types provided by a system or programming language. +Narrow or sub-word integer types refer to integer data types that occupy less memory (fewer bits) than the standard or "full-width" (typically 32 or 64 bits) integer types provided by a system or programming language. As a prelude to arrays, especially arrays of bytes common in all networking @@ -32,34 +35,34 @@ extended on a load. ```java i8 x = 123456789; -if( x != 21 ) +if( x != 21 ) return false; return true; ``` -The variable `x` is limited to 8 bits signed. Assigning the vary large value +The variable `x` is limited to 8 bits signed. Assigning the very large value `123456789` (hex `0x75BCD15`) simply truncates to 8 bits yielding `21 (0x15)`. The value is sign-extended on a load. ```java i16 x = 123456789; -if( x != -13035 ) +if( x != -13035 ) return false; return true; ``` -The variable `x` is limited to 16 bits signed. Assigning the vary large value +The variable `x` is limited to 16 bits signed. Assigning the very large value `0x75BCD15` simply truncates to 16 bits yielding `0xCD15`. The value is sign-extended on a load yielding `-13035 (0xFFFF FFFF FFFF CD15)`. ```java u16 x = 123456789; -if( x != 52501 ) +if( x != 52501 ) return false; return true; ``` -The variable `x` is limited to 16 bits unsigned. Assigning the vary large value +The variable `x` is limited to 16 bits unsigned. Assigning the very large value `0x75BCD15` simply truncates to 16 bits yielding `0xCD15`. The value is zero-extended on a load yielding `52501 (0x0000 0000 0000 CD15)`. @@ -91,10 +94,10 @@ There are several cases of overflow: #### Unsigned(fixed-width) integer overflow: -```java -u8 a = 255; +```java +u8 a = 255; u8 b = a + 1; // match u8 type against expr.type -// a = 256 +// a = 256 // u8 = [0...255] return b; ``` @@ -113,7 +116,7 @@ The operands to the "bitwise AND" are the values(256) and the mask(255, max boun This is called truncating. `ZsMask:` -```java +```java // zero/sign extend. "i" is limited to either classic unsigned (min==0) or // classic signed (min=minus-power-of-2); max=power-of-2-minus-1. private Node zsMask(Node val, Type t ) { @@ -140,29 +143,29 @@ The truncation is done by the `AndNode`: if( t0._min==0 ) // Unsigned return new AndNode(val,con(t0._max)).peephole(); ``` -Since they are constants, after calling peephole it truns into`256 & 255` = 0; +Since they are constants, after calling peephole it turns into `256 & 255` = 0; Output: ``` -return 0; +return 0; ``` #### Maximum integer overflow -```java -i64 a = 9223372036854775807; +```java +i64 a = 9223372036854775807; i64 b = a + 1; return b; ``` When we are computing the addition, we make sure they don't overflow: `AddNode.overflow:` -```java +```java private static boolean overflow( long x, long y ) { if( (x ^ y ) < 0 ) return false; // unequal signs, never overflow return (x ^ (x + y)) < 0; // sum has unequal signs, so overflow } ``` `AddNode.compute` -```java +```java ... // Fold ranges like {0-1} + {2-3} into {2-4}. if( !overflow(i1._min,i2._min) && @@ -183,8 +186,8 @@ return TypeInteger.constant(i1.value()+i2.value()); // -9223372036854775808; ``` #### Adding constant ranges -```java -u8 a = 12; +```java +u8 a = 12; u8 b = 13; u8 c = 124; u8 d = a + b + c; @@ -197,30 +200,30 @@ public static TypeInteger make(boolean is_con, long con) { return make(is_con ? con : (con==0 ? Long.MAX_VALUE : Long.MIN_VALUE), is_con ? con : (con==0 ? Long.MIN_VALUE : Long.MAX_VALUE)); ``` -- This results in: +- This results in: ```java return make(con, con); ``` -`value()` is only called in constants, e.g `_min == _max;` invariants holds, then since +`value()` is only called in constants, e.g `_min == _max;` invariant holds, then since both `min_` and `max_` are equal, we can return either one. This is the same as regular additions: -```java -public long value() { assert isConstant(); return _min; } +```java +public long value() { assert isConstant(); return _min; } ``` #### Truncate(2) -```java +```java u8 a = arg; // arg & 255 u8 b = arg; // arg & 255(same as a) u8 c = a + b; // (arg&255)*2, type = TypeInteger.BOT -return c; // (((arg&255)*2)&255), type = TypeInteger.U8 +return c; // (((arg&255)*2)&255), type = TypeInteger.U8 ``` Same as before, **arg** turns into **(arg&255)**, this node is then inserted into the **GVN** table and **b** retrieves this value. -The AddNode peephole will change them into `((arg&255)*2`, and put on extra mask +The AddNode peephole will change them into `((arg&255)*2)`, and put on extra mask on the expression to keep it in the valid boundaries. @@ -238,15 +241,15 @@ And `&`, Or `|`, Xor `^`, Shift left `<<`, Shift right `>>`, Shift right zero `> | **Or** | `\|` | Performs a bitwise OR (inclusive OR) operation. | | **Xor** | `^` | Performs a bitwise XOR (exclusive OR) operation. | | **Shift Left** | `<<` | Shifts bits to the left, filling with zeros. | -| **Shift Right** | `>>` | Shifts bits to the right, any vacated bit postions are filled by replicating the value of the sign bit. | -| **Unsigned Right Shift** | `>>>` | Shifts bits to the right, any vacated bit postions are always filled with zero | +| **Shift Right** | `>>` | Shifts bits to the right, any vacated bit positions are filled by replicating the value of the sign bit. | +| **Unsigned Right Shift** | `>>>` | Shifts bits to the right, any vacated bit positions are always filled with zero | Note `>>>` is a logical shift and not an arithmetic shift. #### AndNode: ##### lhs & -1 = lhs; -```java +```java // And of -1. We do not check for (-1&x) because this will already // canonicalize to (x&-1) if( t2.isConstant() && t2 instanceof TypeInteger i && i.value()==-1 ) @@ -306,7 +309,7 @@ arg + 123 & 3 = (arg + 123) & 3 ## Type Implementation -The <font style="background-color:lightblue">TypeInteger type</font> class is +The  `TypeInteger` class is reworked to support a full range of min/max values. At this time, only some power-of-2 sized ranges are exposed to the programmer but the optimizer internally supports all ranges. The MEET operation takes the min-of-mins and @@ -322,7 +325,11 @@ Example: the `i8` type has the range `[-128...127]`. Example: the `dual` of `bool` is `[1...0]` (just swap min and max). -The <font style="background-color:aqua">TypeFloat</font> class is also reworked to support 32-bit and 64-bit sizes. +The  `TypeFloat` class is also reworked to support 32-bit and 64-bit sizes. + +The integer range diagram is schematic: it shows the boolean range and its +dual as examples among the possible ranges. The other domains retain the +named structs, nullable pointers, and precise memory aliases from earlier chapters.  @@ -350,4 +357,4 @@ slightly different `idealize()` calls. [^1]: Hacker's delight. - 4-2 Propagating Bounds through Add's and Subtract's + 4-2 Propagating Bounds through Adds and Subtracts diff --git a/chapter14/docs/lattice.gv b/chapter14/docs/lattice.gv index f16a9768..ac2f1f2e 100644 --- a/chapter14/docs/lattice.gv +++ b/chapter14/docs/lattice.gv @@ -1,202 +1,159 @@ digraph Lattice { - compound = true; - // Define nodes - splines=false; - node [shape=circle, style=filled]; - nodesep=0.6; - - TOP [label=<<B>⊤</B >>, fillcolor=black, fontcolor=white]; - BOT [label=<<B>⊥</B>>, fillcolor=black, fontcolor=white]; - - // ---------------------- - // Control - XCTRL [label=<<B>⊤</B >:ctrl>, fillcolor=yellow, shape=oval]; - CTRL [label=<<B>⊥</B>:ctrl>, fillcolor=yellow, shape=oval]; - - TOP -> XCTRL; - XCTRL -> CTRL; - CTRL -> BOT; - - // ---------------------- - // Integers - INT_TOP [label=<<B>⊤</B >:int>, fillcolor=lightblue, shape=oval]; - INT_BOT [label=<<B>⊥</B>:int>, fillcolor=lightblue, shape=oval]; - - INT_HI [label="max < min" , fillcolor=lightblue, shape=oval]; - INT_XBOOL [label="1...0", fillcolor=lightblue, shape=oval]; - INT_CON [label="constants", fillcolor=lightblue, shape=oval]; - INT_CON0 [label="0", fillcolor=lightblue]; - INT_CON1 [label="1", fillcolor=lightblue]; - INT_BOOL [label="0...1", fillcolor=lightblue,shape=oval]; - INT_LO [label="max > min" , fillcolor=lightblue, shape=oval]; - - TOP -> INT_TOP; - INT_TOP -> INT_HI; - INT_HI -> INT_XBOOL; - INT_XBOOL -> INT_CON0; - INT_XBOOL -> INT_CON1; - INT_HI -> INT_CON; - INT_CON0 -> INT_BOOL; - INT_CON1 -> INT_BOOL; - INT_BOOL -> INT_LO; - INT_CON -> INT_LO; - INT_LO -> INT_BOT; - INT_BOT -> BOT; - - INT_CON0 -> INT_CON1 -> INT_CON [style=invis]; - - // ---------------------- - // Floats - FLT_TOP [label=<<B>⊤</B >:flt>, fillcolor=aqua, shape=oval]; - FLT_BOT [label=<<B>⊥</B>:flt>, fillcolor=aqua, shape=oval]; - - FLT_CON64 [label="64b consts\n[excludes\n32b consts]" , fillcolor=aqua, shape=oval]; - FLT_CON32 [label="32b consts", fillcolor=aqua, shape=oval]; - FLT_CONPI [label="3.14159...", fillcolor=aqua, shape=oval]; - FLT_X32 [label="~f32", fillcolor=aqua]; - FLT_CON0 [label="0." , fillcolor=aqua]; - FLT_32 [label="f32" , fillcolor=aqua]; - - TOP -> FLT_TOP; - FLT_TOP -> FLT_CON64 - FLT_TOP -> FLT_CONPI - FLT_CON64 -> FLT_BOT - FLT_CONPI -> FLT_BOT - - FLT_TOP -> FLT_X32; - FLT_X32 -> FLT_CON0; - FLT_X32 -> FLT_CON32; - FLT_CON0 -> FLT_32; - FLT_CON32 -> FLT_32; - FLT_32 -> FLT_BOT - - FLT_BOT -> BOT; - - FLT_CON0 -> FLT_CON32 -> FLT_CONPI -> FLT_CON64 [style=invis]; - - - // ---------------------- - // Pointers, just a boolean nil/not and a struct - PTR [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="green"><FONT color="white">*ptr</FONT></TD></TR> - <TR><TD BGCOLOR="lightgreen">struct</TD></TR> - </TABLE> - >]; - PTR0 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="green"><FONT color="white">*ptr?</FONT></TD></TR> - <TR><TD BGCOLOR="lightgreen">struct</TD></TR> - </TABLE> - >]; - - TOP -> PTR; - PTR -> PTR0; - PTR0 -> BOT; - - // ---------------------- - // Structs - STRUCT_TOP [label=<<B>⊤</B >:struct>, fillcolor=lightgreen, shape=oval]; - STRUCT_BOT [label=<<B>⊥</B>:struct>, fillcolor=lightgreen, shape=oval]; - - STRUCT_S1 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - </TABLE> - >]; - STRUCT_S2 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - </TABLE> - >]; - STRUCT_SN [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - <TR><TD BGCOLOR="lightgreen">... </TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - <TR><TD BGCOLOR="lightgreen">field</TD><TD BGCOLOR="lightblue:green" gradientangle="315">int/ptr</TD></TR> - </TABLE> - >]; - - - TOP -> STRUCT_TOP; - STRUCT_TOP -> STRUCT_S1; - STRUCT_TOP -> STRUCT_S2; - STRUCT_TOP -> STRUCT_SN; - STRUCT_S1 -> STRUCT_BOT; - STRUCT_S2 -> STRUCT_BOT; - STRUCT_SN -> STRUCT_BOT; - STRUCT_BOT -> BOT; - - STRUCT_S1 -> STRUCT_S2 -> STRUCT_SN [style=invis]; - - // ---------------------- - // Memory - MEM_TOP [label=<<B>⊤</B >:mem>, fillcolor=blue, fontcolor=white, shape=oval]; - MEM_BOT [label=<<B>⊥</B>:mem>, fillcolor=blue, fontcolor=white, shape=oval]; - MEM_ALIAS1 [label="#1" , fillcolor=blue, fontcolor=white]; - MEM_ALIASDOTS [label="..." , fillcolor=blue, fontcolor=white, shape=oval]; - MEM_ALIASN [label="#n" , fillcolor=blue, fontcolor=white]; - - TOP -> MEM_TOP; - MEM_TOP -> MEM_ALIAS1; - MEM_TOP -> MEM_ALIASDOTS; - MEM_TOP -> MEM_ALIASN; - MEM_ALIAS1 -> MEM_BOT; - MEM_ALIASDOTS -> MEM_BOT; - MEM_ALIASN -> MEM_BOT; - MEM_BOT -> BOT; - - MEM_ALIAS1 -> MEM_ALIASDOTS -> MEM_ALIASN [style=invis]; - - // ---------------------- - // Tuples - - TUPLE_TOP [label=<<B>⊤</B >:tuple>, fillcolor=pink, shape=oval]; - TUPLE_BOT [label=<<B>⊥</B>:tuple>, fillcolor=pink, shape=oval]; - - TUPLE1 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TH><TD BGCOLOR="pink">Tuple</TD></TH> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - </TABLE> - >]; - TUPLE2 [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TH><TD BGCOLOR="pink">Tuple</TD></TH> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - </TABLE> - >]; - TUPLEN [shape=none, fillcolor=none, label=< - <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> - <TH><TD BGCOLOR="pink">Tuple</TD></TH> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - <TR><TD BGCOLOR="black" ><FONT color="white">...</FONT></TD></TR> - <TR><TD BGCOLOR="black" ><FONT color="white">type</FONT></TD></TR> - </TABLE> - >]; - - - TOP -> TUPLE_TOP; - TUPLE_TOP -> TUPLE1; - TUPLE_TOP -> TUPLE2; - TUPLE_TOP -> TUPLEN; - TUPLE1 -> TUPLE_BOT; - TUPLE2 -> TUPLE_BOT; - TUPLEN -> TUPLE_BOT; - TUPLE_BOT -> BOT; - - // ---------------------- - // Additional customization - {rank=same; TOP;} - {rank=same; INT_TOP; FLT_TOP; XCTRL; PTR; STRUCT_TOP; MEM_TOP; TUPLE_TOP} - {rank=same; INT_CON; INT_CON0; INT_CON1; - FLT_CON32; FLT_CON64; FLT_CON0; FLT_CONPI; - STRUCT_S1; STRUCT_S2; STRUCT_SN; - MEM_ALIAS1; MEM_ALIASDOTS; MEM_ALIASN; - TUPLE1; TUPLE2; TUPLEN; + rankdir=TB; + newrank=true; + // Preserve the same-rank ordering edges through cluster layout. + remincross=false; + nodesep=0.22; + ranksep=0.65; + node [shape=ellipse, style=filled, fontname="DejaVu Sans", fontsize=13]; + edge [color="#555555", arrowsize=0.6]; + + // These arrows are lattice-order edges, not use/definition edges. + TOP [label="⊤", fillcolor=black, fontcolor=white]; + BOT [label="⊥", fillcolor=black, fontcolor=white]; + + subgraph cluster_control { + label="Control"; fontname="Arial"; color="#cccccc"; + node [fillcolor="#ffff00"]; + XCTRL [label="⊤:ctrl"]; + CTRL [label="⊥:ctrl"]; + XCTRL -> CTRL; } - {rank=same; INT_BOT; FLT_BOT; CTRL; PTR0; STRUCT_BOT; MEM_BOT; TUPLE_BOT} - {rank=same; BOT;} + + subgraph cluster_integer { + label="Integer ranges (schematic)"; fontname="Arial"; color="#cccccc"; + INT_TOP [label=<<B>⊤</B >:int>, fillcolor=lightblue, shape=oval]; + INT_BOT [label=<<B>⊥</B>:int>, fillcolor=lightblue, shape=oval]; + + INT_HI [label="max < min" , fillcolor=lightblue, shape=oval]; + INT_XBOOL [label="1...0", fillcolor=lightblue, shape=oval]; + INT_CON [label="constants", fillcolor=lightblue, shape=oval]; + INT_CON0 [label="0", fillcolor=lightblue]; + INT_CON1 [label="1", fillcolor=lightblue]; + INT_BOOL [label="0...1", fillcolor=lightblue,shape=oval]; + INT_LO [label="max > min" , fillcolor=lightblue, shape=oval]; + + INT_TOP -> INT_HI; + INT_HI -> INT_XBOOL; + INT_XBOOL -> INT_CON0; + INT_XBOOL -> INT_CON1; + INT_HI -> INT_CON; + INT_CON0 -> INT_BOOL; + INT_CON1 -> INT_BOOL; + INT_BOOL -> INT_LO; + INT_CON -> INT_LO; + INT_LO -> INT_BOT; + + INT_CON0 -> INT_CON1 -> INT_CON [style=invis]; + + {rank=same; INT_CON0; INT_CON1; INT_CON;} + } + + subgraph cluster_float { + label="Float"; fontname="Arial"; color="#cccccc"; + FLT_TOP [label=<<B>⊤</B >:flt>, fillcolor=aqua, shape=oval]; + FLT_BOT [label=<<B>⊥</B>:flt>, fillcolor=aqua, shape=oval]; + + FLT_CON64 [label="64b consts\n[excludes\n32b consts]" , fillcolor=aqua, shape=oval]; + FLT_CON32 [label="32b consts", fillcolor=aqua, shape=oval]; + FLT_CONPI [label="3.14159...", fillcolor=aqua, shape=oval]; + FLT_X32 [label="~f32", fillcolor=aqua]; + FLT_CON0 [label="0." , fillcolor=aqua]; + FLT_32 [label="f32" , fillcolor=aqua]; + + FLT_TOP -> FLT_CON64 + FLT_TOP -> FLT_CONPI + FLT_CON64 -> FLT_BOT + FLT_CONPI -> FLT_BOT + + FLT_TOP -> FLT_X32; + FLT_X32 -> FLT_CON0; + FLT_X32 -> FLT_CON32; + FLT_CON0 -> FLT_32; + FLT_CON32 -> FLT_32; + FLT_32 -> FLT_BOT + + FLT_CON0 -> FLT_CON32 -> FLT_CONPI -> FLT_CON64 [style=invis]; + + + {rank=same; FLT_CON0; FLT_CON32; FLT_CONPI; FLT_CON64;} + } + + subgraph cluster_pointer { + label="Pointer = nullability × struct type"; + fontname="Arial"; color="#cccccc"; + node [fillcolor="#008000", fontcolor=white]; + PTR_TOP [label="⊤:ptr\n[*⊤:struct]"]; + PTR_BOT [label="⊥:ptr\n[*⊥:struct?]"]; + PTR_NULL [label="null"]; + PTR_ANY [label="*⊥:struct\n[ptr any struct]"]; + PTR_PERSON [label="*Person"]; + PTR_S1 [label="*s1"]; + PTR_MORE [label="*s2, …"]; + PTR_PERSON_NIL [label="*Person?"]; + PTR_S1_NIL [label="*s1?"]; + PTR_MORE_NIL [label="*s2?, …"]; + {rank=same; PTR_PERSON; PTR_S1; PTR_MORE; PTR_NULL;} + {rank=same; PTR_ANY; PTR_PERSON_NIL; PTR_S1_NIL; PTR_MORE_NIL;} + PTR_PERSON -> PTR_S1 -> PTR_MORE -> PTR_NULL [style=invis]; + PTR_ANY -> PTR_PERSON_NIL -> PTR_S1_NIL -> PTR_MORE_NIL [style=invis]; + PTR_TOP -> {PTR_PERSON PTR_S1 PTR_MORE PTR_NULL}; + {PTR_PERSON PTR_S1 PTR_MORE} -> PTR_ANY; + PTR_PERSON -> PTR_PERSON_NIL; + PTR_S1 -> PTR_S1_NIL; + PTR_MORE -> PTR_MORE_NIL; + PTR_NULL -> {PTR_PERSON_NIL PTR_S1_NIL PTR_MORE_NIL}; + {PTR_ANY PTR_PERSON_NIL PTR_S1_NIL PTR_MORE_NIL} -> PTR_BOT; + } + + subgraph cluster_struct { + label="Struct\nnamed collection of named scalar types"; + fontname="Arial"; color="#cccccc"; + node [fillcolor="#90ee90"]; + STRUCT_TOP [label="⊤:struct\n[struct top]"]; + STRUCT_BOT [label="⊥:struct\n[struct bottom]"]; + STRUCT_PERSON [label="Person\nage: int", shape=box]; + STRUCT_S1 [label="s1\nx: int", shape=box]; + STRUCT_S2 [label="s2\nx: int, y: *s1", shape=box]; + STRUCT_MORE [label="…", shape=box]; + {rank=same; STRUCT_PERSON; STRUCT_S1; STRUCT_S2; STRUCT_MORE;} + STRUCT_PERSON -> STRUCT_S1 -> STRUCT_S2 -> STRUCT_MORE [style=invis]; + STRUCT_TOP -> {STRUCT_PERSON STRUCT_S1 STRUCT_S2 STRUCT_MORE}; + {STRUCT_PERSON STRUCT_S1 STRUCT_S2 STRUCT_MORE} -> STRUCT_BOT; + } + + subgraph cluster_memory { + label="Memory\nprecise alias slices"; fontname="Arial"; color="#cccccc"; + node [fillcolor="#00008b", fontcolor=white]; + MEM_TOP [label="⊤:mem"]; + MEM_BOT [label="⊥:mem"]; + MEM_ALIAS2 [label="MEM#2"]; + MEM_ALIAS3 [label="MEM#3"]; + MEM_MORE [label="…"]; + {rank=same; MEM_ALIAS2; MEM_ALIAS3; MEM_MORE;} + MEM_ALIAS2 -> MEM_ALIAS3 -> MEM_MORE [style=invis]; + MEM_TOP -> {MEM_ALIAS2 MEM_ALIAS3 MEM_MORE}; + {MEM_ALIAS2 MEM_ALIAS3 MEM_MORE} -> MEM_BOT; + } + + subgraph cluster_tuple { + label="Tuple\ncollection of types"; + fontname="Arial"; color="#cccccc"; + node [fillcolor="#ffc0cb"]; + TUPLE_TOP [label="⊤:tuple"]; + TUPLE_BOT [label="⊥:tuple"]; + TUPLE1 [label="(type)", shape=box]; + TUPLE2 [label="(type, type)", shape=box]; + TUPLEN [label="(type, …)", shape=box]; + {rank=same; TUPLE1; TUPLE2; TUPLEN;} + TUPLE1 -> TUPLE2 -> TUPLEN [style=invis]; + TUPLE_TOP -> {TUPLE1 TUPLE2 TUPLEN}; + {TUPLE1 TUPLE2 TUPLEN} -> TUPLE_BOT; + } + + TOP -> {XCTRL INT_TOP FLT_TOP PTR_TOP STRUCT_TOP MEM_TOP TUPLE_TOP}; + {CTRL INT_BOT FLT_BOT PTR_BOT STRUCT_BOT MEM_BOT TUPLE_BOT} -> BOT; + {rank=same; XCTRL; INT_TOP; FLT_TOP; PTR_TOP; STRUCT_TOP; MEM_TOP; TUPLE_TOP;} + {rank=same; CTRL; INT_BOT; FLT_BOT; PTR_BOT; STRUCT_BOT; MEM_BOT; TUPLE_BOT;} + XCTRL -> INT_TOP -> FLT_TOP -> PTR_TOP -> STRUCT_TOP -> MEM_TOP -> TUPLE_TOP [style=invis]; } diff --git a/chapter14/docs/lattice.svg b/chapter14/docs/lattice.svg index 99f74ed0..131b5601 100644 --- a/chapter14/docs/lattice.svg +++ b/chapter14/docs/lattice.svg @@ -1,691 +1,803 @@ -<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
- "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<!-- Generated by graphviz version 12.2.0 (20241103.1931)
- -->
-<!-- Title: Lattice Pages: 1 -->
-<svg width="1800pt" height="760pt"
- viewBox="0.00 0.00 1800.00 759.54" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
-<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 755.54)">
-<title>Lattice</title>
-<polygon fill="white" stroke="none" points="-4,4 -4,-755.54 1796,-755.54 1796,4 -4,4"/>
-<!-- TOP -->
-<g id="node1" class="node">
-<title>TOP</title>
-<ellipse fill="black" stroke="black" cx="829" cy="-730.42" rx="21.12" ry="21.12"/>
-<text text-anchor="start" x="821.12" y="-725.99" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊤</text>
-</g>
-<!-- XCTRL -->
-<g id="node3" class="node">
-<title>XCTRL</title>
-<ellipse fill="yellow" stroke="black" cx="45" cy="-646.79" rx="36.51" ry="18"/>
-<text text-anchor="start" x="26.25" y="-642.74" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="42" y="-642.74" font-family="Times New Roman,serif" font-size="14.00">:ctrl</text>
-</g>
-<!-- TOP->XCTRL -->
-<g id="edge1" class="edge">
-<title>TOP->XCTRL</title>
-<path fill="none" stroke="black" d="M807.62,-727.19C702.73,-716.27 241.49,-668.25 91.97,-652.68"/>
-<polygon fill="black" stroke="black" points="92.33,-649.2 82.02,-651.65 91.61,-656.16 92.33,-649.2"/>
-</g>
-<!-- INT_TOP -->
-<g id="node5" class="node">
-<title>INT_TOP</title>
-<ellipse fill="lightblue" stroke="black" cx="404" cy="-646.79" rx="33.95" ry="18"/>
-<text text-anchor="start" x="387.12" y="-642.74" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="402.88" y="-642.74" font-family="Times New Roman,serif" font-size="14.00">:int</text>
-</g>
-<!-- TOP->INT_TOP -->
-<g id="edge4" class="edge">
-<title>TOP->INT_TOP</title>
-<path fill="none" stroke="black" d="M808.21,-725.42C742.28,-712.76 536.86,-673.31 446.91,-656.03"/>
-<polygon fill="black" stroke="black" points="447.74,-652.63 437.26,-654.18 446.42,-659.5 447.74,-652.63"/>
-</g>
-<!-- FLT_TOP -->
-<g id="node14" class="node">
-<title>FLT_TOP</title>
-<ellipse fill="aqua" stroke="black" cx="636" cy="-646.79" rx="32.41" ry="18"/>
-<text text-anchor="start" x="620.25" y="-642.74" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="636" y="-642.74" font-family="Times New Roman,serif" font-size="14.00">:flt</text>
-</g>
-<!-- TOP->FLT_TOP -->
-<g id="edge18" class="edge">
-<title>TOP->FLT_TOP</title>
-<path fill="none" stroke="black" d="M809.79,-721.29C777.65,-707.7 712.5,-680.14 671.73,-662.91"/>
-<polygon fill="black" stroke="black" points="673.15,-659.7 662.58,-659.03 670.42,-666.15 673.15,-659.7"/>
-</g>
-<!-- PTR -->
-<g id="node22" class="node">
-<title>PTR</title>
-<polygon fill="none" stroke="none" points="856,-673.29 802,-673.29 802,-620.29 856,-620.29 856,-673.29"/>
-<polygon fill="green" stroke="none" points="811,-646.79 811,-669.29 847,-669.29 847,-646.79 811,-646.79"/>
-<polygon fill="none" stroke="black" points="811,-646.79 811,-669.29 847,-669.29 847,-646.79 811,-646.79"/>
-<text text-anchor="start" x="818.12" y="-652.99" font-family="Times New Roman,serif" font-size="14.00" fill="white">*ptr</text>
-<polygon fill="lightgreen" stroke="none" points="811,-624.29 811,-646.79 847,-646.79 847,-624.29 811,-624.29"/>
-<polygon fill="none" stroke="black" points="811,-624.29 811,-646.79 847,-646.79 847,-624.29 811,-624.29"/>
-<text text-anchor="start" x="814" y="-630.49" font-family="Times New Roman,serif" font-size="14.00">struct</text>
-</g>
-<!-- TOP->PTR -->
-<g id="edge33" class="edge">
-<title>TOP->PTR</title>
-<path fill="none" stroke="black" d="M829,-708.82C829,-701.44 829,-692.87 829,-684.54"/>
-<polygon fill="black" stroke="black" points="832.5,-684.57 829,-674.57 825.5,-684.57 832.5,-684.57"/>
-</g>
-<!-- STRUCT_TOP -->
-<g id="node24" class="node">
-<title>STRUCT_TOP</title>
-<ellipse fill="lightgreen" stroke="black" cx="997" cy="-646.79" rx="44.7" ry="18"/>
-<text text-anchor="start" x="972.25" y="-642.74" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="988" y="-642.74" font-family="Times New Roman,serif" font-size="14.00">:struct</text>
-</g>
-<!-- TOP->STRUCT_TOP -->
-<g id="edge36" class="edge">
-<title>TOP->STRUCT_TOP</title>
-<path fill="none" stroke="black" d="M847.95,-720.21C874.78,-707.18 924.42,-683.06 959.01,-666.25"/>
-<polygon fill="black" stroke="black" points="960.39,-669.47 967.86,-661.95 957.34,-663.17 960.39,-669.47"/>
-</g>
-<!-- MEM_TOP -->
-<g id="node29" class="node">
-<title>MEM_TOP</title>
-<ellipse fill="blue" stroke="black" cx="1346" cy="-646.79" rx="43.67" ry="18"/>
-<text text-anchor="start" x="1322" y="-642.74" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊤</text>
-<text text-anchor="start" x="1337.75" y="-642.74" font-family="Times New Roman,serif" font-size="14.00" fill="white">:mem</text>
-</g>
-<!-- TOP->MEM_TOP -->
-<g id="edge46" class="edge">
-<title>TOP->MEM_TOP</title>
-<path fill="none" stroke="black" d="M849.91,-726.12C925.08,-714.25 1183.05,-673.52 1294.28,-655.96"/>
-<polygon fill="black" stroke="black" points="1294.7,-659.44 1304.03,-654.42 1293.61,-652.52 1294.7,-659.44"/>
-</g>
-<!-- TUPLE_TOP -->
-<g id="node34" class="node">
-<title>TUPLE_TOP</title>
-<ellipse fill="pink" stroke="black" cx="1619" cy="-646.79" rx="42.65" ry="18"/>
-<text text-anchor="start" x="1595.75" y="-642.74" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊤</text>
-<text text-anchor="start" x="1611.5" y="-642.74" font-family="Times New Roman,serif" font-size="14.00">:tuple</text>
-</g>
-<!-- TOP->TUPLE_TOP -->
-<g id="edge56" class="edge">
-<title>TOP->TUPLE_TOP</title>
-<path fill="none" stroke="black" d="M850.13,-727.23C953.9,-716.51 1410.83,-669.3 1566.7,-653.2"/>
-<polygon fill="black" stroke="black" points="1566.73,-656.71 1576.32,-652.2 1566.01,-649.75 1566.73,-656.71"/>
-</g>
-<!-- BOT -->
-<g id="node2" class="node">
-<title>BOT</title>
-<ellipse fill="black" stroke="black" cx="829" cy="-21.12" rx="21.12" ry="21.12"/>
-<text text-anchor="start" x="821.12" y="-16.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊥</text>
-</g>
-<!-- CTRL -->
-<g id="node4" class="node">
-<title>CTRL</title>
-<ellipse fill="yellow" stroke="black" cx="44" cy="-104.75" rx="36.51" ry="18"/>
-<text text-anchor="start" x="25.25" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="41" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:ctrl</text>
-</g>
-<!-- XCTRL->CTRL -->
-<g id="edge2" class="edge">
-<title>XCTRL->CTRL</title>
-<path fill="none" stroke="black" d="M44.97,-628.45C44.82,-548.91 44.24,-233.44 44.05,-134.55"/>
-<polygon fill="black" stroke="black" points="47.56,-134.6 44.04,-124.6 40.56,-134.61 47.56,-134.6"/>
-</g>
-<!-- CTRL->BOT -->
-<g id="edge3" class="edge">
-<title>CTRL->BOT</title>
-<path fill="none" stroke="black" d="M79.77,-100.03C211.83,-86.3 670.83,-38.57 796.8,-25.47"/>
-<polygon fill="black" stroke="black" points="796.84,-28.99 806.43,-24.47 796.12,-22.02 796.84,-28.99"/>
-</g>
-<!-- INT_HI -->
-<g id="node7" class="node">
-<title>INT_HI</title>
-<ellipse fill="lightblue" stroke="black" cx="203" cy="-566.29" rx="52.89" ry="18"/>
-<text text-anchor="middle" x="203" y="-561.24" font-family="Times New Roman,serif" font-size="14.00">max < min</text>
-</g>
-<!-- INT_TOP->INT_HI -->
-<g id="edge5" class="edge">
-<title>INT_TOP->INT_HI</title>
-<path fill="none" stroke="black" d="M377.31,-635.37C344.15,-622.42 287.09,-600.13 247.33,-584.6"/>
-<polygon fill="black" stroke="black" points="248.85,-581.44 238.26,-581.06 246.31,-587.96 248.85,-581.44"/>
-</g>
-<!-- INT_BOT -->
-<g id="node6" class="node">
-<title>INT_BOT</title>
-<ellipse fill="lightblue" stroke="black" cx="404" cy="-104.75" rx="33.95" ry="18"/>
-<text text-anchor="start" x="387.12" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="402.88" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:int</text>
-</g>
-<!-- INT_BOT->BOT -->
-<g id="edge15" class="edge">
-<title>INT_BOT->BOT</title>
-<path fill="none" stroke="black" d="M435.6,-97.68C514.28,-82.57 718.3,-43.39 797.2,-28.23"/>
-<polygon fill="black" stroke="black" points="797.68,-31.7 806.84,-26.38 796.36,-24.83 797.68,-31.7"/>
-</g>
-<!-- INT_XBOOL -->
-<g id="node8" class="node">
-<title>INT_XBOOL</title>
-<ellipse fill="lightblue" stroke="black" cx="97" cy="-483.97" rx="27.81" ry="18"/>
-<text text-anchor="middle" x="97" y="-478.92" font-family="Times New Roman,serif" font-size="14.00">1...0</text>
-</g>
-<!-- INT_HI->INT_XBOOL -->
-<g id="edge6" class="edge">
-<title>INT_HI->INT_XBOOL</title>
-<path fill="none" stroke="black" d="M182.06,-549.42C165.21,-536.65 141.43,-518.64 123.29,-504.9"/>
-<polygon fill="black" stroke="black" points="125.68,-502.32 115.6,-499.07 121.46,-507.89 125.68,-502.32"/>
-</g>
-<!-- INT_CON -->
-<g id="node9" class="node">
-<title>INT_CON</title>
-<ellipse fill="lightblue" stroke="black" cx="203" cy="-370.65" rx="45.21" ry="18"/>
-<text text-anchor="middle" x="203" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">constants</text>
-</g>
-<!-- INT_HI->INT_CON -->
-<g id="edge9" class="edge">
-<title>INT_HI->INT_CON</title>
-<path fill="none" stroke="black" d="M203,-547.89C203,-514.02 203,-441.56 203,-400.55"/>
-<polygon fill="black" stroke="black" points="206.5,-400.66 203,-390.66 199.5,-400.66 206.5,-400.66"/>
-</g>
-<!-- INT_CON0 -->
-<g id="node10" class="node">
-<title>INT_CON0</title>
-<ellipse fill="lightblue" stroke="black" cx="18" cy="-370.65" rx="18" ry="18"/>
-<text text-anchor="middle" x="18" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">0</text>
-</g>
-<!-- INT_XBOOL->INT_CON0 -->
-<g id="edge7" class="edge">
-<title>INT_XBOOL->INT_CON0</title>
-<path fill="none" stroke="black" d="M85.68,-467.02C72.29,-448.15 49.88,-416.57 34.54,-394.96"/>
-<polygon fill="black" stroke="black" points="37.56,-393.17 28.92,-387.04 31.86,-397.22 37.56,-393.17"/>
-</g>
-<!-- INT_CON1 -->
-<g id="node11" class="node">
-<title>INT_CON1</title>
-<ellipse fill="lightblue" stroke="black" cx="97" cy="-370.65" rx="18" ry="18"/>
-<text text-anchor="middle" x="97" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">1</text>
-</g>
-<!-- INT_XBOOL->INT_CON1 -->
-<g id="edge8" class="edge">
-<title>INT_XBOOL->INT_CON1</title>
-<path fill="none" stroke="black" d="M97,-465.58C97,-448.1 97,-420.85 97,-400.2"/>
-<polygon fill="black" stroke="black" points="100.5,-400.44 97,-390.44 93.5,-400.44 100.5,-400.44"/>
-</g>
-<!-- INT_LO -->
-<g id="node13" class="node">
-<title>INT_LO</title>
-<ellipse fill="lightblue" stroke="black" cx="203" cy="-185.25" rx="52.89" ry="18"/>
-<text text-anchor="middle" x="203" y="-180.2" font-family="Times New Roman,serif" font-size="14.00">max > min</text>
-</g>
-<!-- INT_CON->INT_LO -->
-<g id="edge13" class="edge">
-<title>INT_CON->INT_LO</title>
-<path fill="none" stroke="black" d="M203,-352.2C203,-320.06 203,-253.57 203,-214.9"/>
-<polygon fill="black" stroke="black" points="206.5,-215.14 203,-205.14 199.5,-215.14 206.5,-215.14"/>
-</g>
-<!-- INT_CON0->INT_CON1 -->
-<!-- INT_BOOL -->
-<g id="node12" class="node">
-<title>INT_BOOL</title>
-<ellipse fill="lightblue" stroke="black" cx="97" cy="-262.45" rx="27.81" ry="18"/>
-<text text-anchor="middle" x="97" y="-257.4" font-family="Times New Roman,serif" font-size="14.00">0...1</text>
-</g>
-<!-- INT_CON0->INT_BOOL -->
-<g id="edge10" class="edge">
-<title>INT_CON0->INT_BOOL</title>
-<path fill="none" stroke="black" d="M28.33,-355.77C41.09,-338.61 63.05,-309.09 78.7,-288.06"/>
-<polygon fill="black" stroke="black" points="81.32,-290.39 84.48,-280.28 75.71,-286.21 81.32,-290.39"/>
-</g>
-<!-- INT_CON1->INT_CON -->
-<!-- INT_CON1->INT_BOOL -->
-<g id="edge11" class="edge">
-<title>INT_CON1->INT_BOOL</title>
-<path fill="none" stroke="black" d="M97,-352.59C97,-336.35 97,-311.6 97,-292.3"/>
-<polygon fill="black" stroke="black" points="100.5,-292.34 97,-282.34 93.5,-292.34 100.5,-292.34"/>
-</g>
-<!-- INT_BOOL->INT_LO -->
-<g id="edge12" class="edge">
-<title>INT_BOOL->INT_LO</title>
-<path fill="none" stroke="black" d="M114.98,-248.69C130.47,-237.7 153.19,-221.59 171.67,-208.48"/>
-<polygon fill="black" stroke="black" points="173.51,-211.46 179.65,-202.82 169.46,-205.75 173.51,-211.46"/>
-</g>
-<!-- INT_LO->INT_BOT -->
-<g id="edge14" class="edge">
-<title>INT_LO->INT_BOT</title>
-<path fill="none" stroke="black" d="M236.64,-171.11C272.65,-157.05 329.61,-134.8 366.9,-120.24"/>
-<polygon fill="black" stroke="black" points="367.88,-123.61 375.92,-116.72 365.33,-117.09 367.88,-123.61"/>
-</g>
-<!-- FLT_CON64 -->
-<g id="node16" class="node">
-<title>FLT_CON64</title>
-<ellipse fill="aqua" stroke="black" cx="709" cy="-370.65" rx="55.33" ry="40.66"/>
-<text text-anchor="middle" x="709" y="-382.1" font-family="Times New Roman,serif" font-size="14.00">64b consts</text>
-<text text-anchor="middle" x="709" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">[excludes</text>
-<text text-anchor="middle" x="709" y="-349.1" font-family="Times New Roman,serif" font-size="14.00">32b consts]</text>
-</g>
-<!-- FLT_TOP->FLT_CON64 -->
-<g id="edge19" class="edge">
-<title>FLT_TOP->FLT_CON64</title>
-<path fill="none" stroke="black" d="M640.79,-628.67C651.74,-587.25 678.94,-484.36 695.5,-421.74"/>
-<polygon fill="black" stroke="black" points="698.8,-422.94 697.97,-412.38 692.03,-421.15 698.8,-422.94"/>
-</g>
-<!-- FLT_CONPI -->
-<g id="node18" class="node">
-<title>FLT_CONPI</title>
-<ellipse fill="aqua" stroke="black" cx="562" cy="-370.65" rx="48.79" ry="18"/>
-<text text-anchor="middle" x="562" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">3.14159...</text>
-</g>
-<!-- FLT_TOP->FLT_CONPI -->
-<g id="edge20" class="edge">
-<title>FLT_TOP->FLT_CONPI</title>
-<path fill="none" stroke="black" d="M631.14,-628.67C618.63,-581.96 585.17,-457.11 569.85,-399.95"/>
-<polygon fill="black" stroke="black" points="573.23,-399.05 567.27,-390.3 566.47,-400.86 573.23,-399.05"/>
-</g>
-<!-- FLT_X32 -->
-<g id="node19" class="node">
-<title>FLT_X32</title>
-<ellipse fill="aqua" stroke="black" cx="420" cy="-483.97" rx="28.32" ry="28.32"/>
-<text text-anchor="middle" x="420" y="-478.92" font-family="Times New Roman,serif" font-size="14.00">~f32</text>
-</g>
-<!-- FLT_TOP->FLT_X32 -->
-<g id="edge23" class="edge">
-<title>FLT_TOP->FLT_X32</title>
-<path fill="none" stroke="black" d="M616.45,-632.06C579.12,-603.92 497.39,-542.31 451.99,-508.09"/>
-<polygon fill="black" stroke="black" points="454.19,-505.36 444.09,-502.13 449.97,-510.95 454.19,-505.36"/>
-</g>
-<!-- FLT_BOT -->
-<g id="node15" class="node">
-<title>FLT_BOT</title>
-<ellipse fill="aqua" stroke="black" cx="636" cy="-104.75" rx="32.41" ry="18"/>
-<text text-anchor="start" x="620.25" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="636" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:flt</text>
-</g>
-<!-- FLT_BOT->BOT -->
-<g id="edge29" class="edge">
-<title>FLT_BOT->BOT</title>
-<path fill="none" stroke="black" d="M661.23,-93.08C696.76,-78.05 761.4,-50.72 799.23,-34.72"/>
-<polygon fill="black" stroke="black" points="800.35,-38.04 808.2,-30.92 797.63,-31.59 800.35,-38.04"/>
-</g>
-<!-- FLT_CON64->FLT_BOT -->
-<g id="edge21" class="edge">
-<title>FLT_CON64->FLT_BOT</title>
-<path fill="none" stroke="black" d="M697.99,-330.56C683.16,-276.52 657.1,-181.62 644,-133.89"/>
-<polygon fill="black" stroke="black" points="647.39,-133 641.36,-124.29 640.64,-134.86 647.39,-133"/>
-</g>
-<!-- FLT_CON32 -->
-<g id="node17" class="node">
-<title>FLT_CON32</title>
-<ellipse fill="aqua" stroke="black" cx="420" cy="-370.65" rx="50.33" ry="18"/>
-<text text-anchor="middle" x="420" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">32b consts</text>
-</g>
-<!-- FLT_CON32->FLT_CONPI -->
-<!-- FLT_32 -->
-<g id="node21" class="node">
-<title>FLT_32</title>
-<ellipse fill="aqua" stroke="black" cx="420" cy="-262.45" rx="23.2" ry="23.2"/>
-<text text-anchor="middle" x="420" y="-257.4" font-family="Times New Roman,serif" font-size="14.00">f32</text>
-</g>
-<!-- FLT_CON32->FLT_32 -->
-<g id="edge27" class="edge">
-<title>FLT_CON32->FLT_32</title>
-<path fill="none" stroke="black" d="M420,-352.59C420,-337.77 420,-315.87 420,-297.49"/>
-<polygon fill="black" stroke="black" points="423.5,-297.54 420,-287.54 416.5,-297.54 423.5,-297.54"/>
-</g>
-<!-- FLT_CONPI->FLT_BOT -->
-<g id="edge22" class="edge">
-<title>FLT_CONPI->FLT_BOT</title>
-<path fill="none" stroke="black" d="M567.09,-352.38C579.71,-307.01 612.57,-188.95 627.9,-133.86"/>
-<polygon fill="black" stroke="black" points="631.26,-134.83 630.57,-124.26 624.52,-132.95 631.26,-134.83"/>
-</g>
-<!-- FLT_CONPI->FLT_CON64 -->
-<!-- FLT_X32->FLT_CON32 -->
-<g id="edge25" class="edge">
-<title>FLT_X32->FLT_CON32</title>
-<path fill="none" stroke="black" d="M420,-455.17C420,-438.48 420,-417.3 420,-400.44"/>
-<polygon fill="black" stroke="black" points="423.5,-400.57 420,-390.57 416.5,-400.57 423.5,-400.57"/>
-</g>
-<!-- FLT_CON0 -->
-<g id="node20" class="node">
-<title>FLT_CON0</title>
-<ellipse fill="aqua" stroke="black" cx="309" cy="-370.65" rx="18.08" ry="18.08"/>
-<text text-anchor="middle" x="309" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">0.</text>
-</g>
-<!-- FLT_X32->FLT_CON0 -->
-<g id="edge24" class="edge">
-<title>FLT_X32->FLT_CON0</title>
-<path fill="none" stroke="black" d="M400.41,-463.33C380.48,-443.34 349.72,-412.49 329.47,-392.18"/>
-<polygon fill="black" stroke="black" points="332.11,-389.87 322.57,-385.26 327.15,-394.82 332.11,-389.87"/>
-</g>
-<!-- FLT_CON0->FLT_CON32 -->
-<!-- FLT_CON0->FLT_32 -->
-<g id="edge26" class="edge">
-<title>FLT_CON0->FLT_32</title>
-<path fill="none" stroke="black" d="M321.73,-357.47C339.61,-340.37 372.5,-308.9 395.28,-287.1"/>
-<polygon fill="black" stroke="black" points="397.56,-289.76 402.37,-280.32 392.72,-284.71 397.56,-289.76"/>
-</g>
-<!-- FLT_32->FLT_BOT -->
-<g id="edge28" class="edge">
-<title>FLT_32->FLT_BOT</title>
-<path fill="none" stroke="black" d="M438.79,-248.73C476.56,-221.15 561.91,-158.84 606.94,-125.97"/>
-<polygon fill="black" stroke="black" points="608.93,-128.85 614.94,-120.12 604.8,-123.19 608.93,-128.85"/>
-</g>
-<!-- PTR0 -->
-<g id="node23" class="node">
-<title>PTR0</title>
-<polygon fill="none" stroke="none" points="856,-131.25 802,-131.25 802,-78.25 856,-78.25 856,-131.25"/>
-<polygon fill="green" stroke="none" points="811,-104.75 811,-127.25 847,-127.25 847,-104.75 811,-104.75"/>
-<polygon fill="none" stroke="black" points="811,-104.75 811,-127.25 847,-127.25 847,-104.75 811,-104.75"/>
-<text text-anchor="start" x="815.12" y="-110.95" font-family="Times New Roman,serif" font-size="14.00" fill="white">*ptr?</text>
-<polygon fill="lightgreen" stroke="none" points="811,-82.25 811,-104.75 847,-104.75 847,-82.25 811,-82.25"/>
-<polygon fill="none" stroke="black" points="811,-82.25 811,-104.75 847,-104.75 847,-82.25 811,-82.25"/>
-<text text-anchor="start" x="814" y="-88.45" font-family="Times New Roman,serif" font-size="14.00">struct</text>
-</g>
-<!-- PTR->PTR0 -->
-<g id="edge34" class="edge">
-<title>PTR->PTR0</title>
-<path fill="none" stroke="black" d="M829,-620.65C829,-532.47 829,-245.72 829,-142.34"/>
-<polygon fill="black" stroke="black" points="832.5,-142.46 829,-132.46 825.5,-142.46 832.5,-142.46"/>
-</g>
-<!-- PTR0->BOT -->
-<g id="edge35" class="edge">
-<title>PTR0->BOT</title>
-<path fill="none" stroke="black" d="M829,-78.37C829,-70.63 829,-62.03 829,-53.93"/>
-<polygon fill="black" stroke="black" points="832.5,-54.09 829,-44.09 825.5,-54.09 832.5,-54.09"/>
-</g>
-<!-- STRUCT_S1 -->
-<g id="node26" class="node">
-<title>STRUCT_S1</title>
-<polygon fill="none" stroke="none" points="979.88,-388.65 894.12,-388.65 894.12,-352.65 979.88,-352.65 979.88,-388.65"/>
-<polygon fill="lightgreen" stroke="none" points="902.12,-359.4 902.12,-381.9 932.88,-381.9 932.88,-359.4 902.12,-359.4"/>
-<polygon fill="none" stroke="black" points="902.12,-359.4 902.12,-381.9 932.88,-381.9 932.88,-359.4 902.12,-359.4"/>
-<text text-anchor="start" x="905.12" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_0" gradientUnits="userSpaceOnUse" x1="938.59" y1="-378.61" x2="966.16" y2="-362.7" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_0)" stroke="none" points="932.88,-359.4 932.88,-381.9 971.88,-381.9 971.88,-359.4 932.88,-359.4"/>
-<polygon fill="none" stroke="black" points="932.88,-359.4 932.88,-381.9 971.88,-381.9 971.88,-359.4 932.88,-359.4"/>
-<text text-anchor="start" x="935.88" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-</g>
-<!-- STRUCT_TOP->STRUCT_S1 -->
-<g id="edge37" class="edge">
-<title>STRUCT_TOP->STRUCT_S1</title>
-<path fill="none" stroke="black" d="M993.06,-628.67C982.89,-581.85 955.66,-456.51 943.28,-399.54"/>
-<polygon fill="black" stroke="black" points="946.74,-398.99 941.19,-389.96 939.9,-400.47 946.74,-398.99"/>
-</g>
-<!-- STRUCT_S2 -->
-<g id="node27" class="node">
-<title>STRUCT_S2</title>
-<polygon fill="none" stroke="none" points="1108.88,-397.15 1023.12,-397.15 1023.12,-344.15 1108.88,-344.15 1108.88,-397.15"/>
-<polygon fill="lightgreen" stroke="none" points="1031.12,-370.65 1031.12,-393.15 1061.88,-393.15 1061.88,-370.65 1031.12,-370.65"/>
-<polygon fill="none" stroke="black" points="1031.12,-370.65 1031.12,-393.15 1061.88,-393.15 1061.88,-370.65 1031.12,-370.65"/>
-<text text-anchor="start" x="1034.12" y="-376.85" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_1" gradientUnits="userSpaceOnUse" x1="1067.59" y1="-389.86" x2="1095.16" y2="-373.95" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_1)" stroke="none" points="1061.88,-370.65 1061.88,-393.15 1100.88,-393.15 1100.88,-370.65 1061.88,-370.65"/>
-<polygon fill="none" stroke="black" points="1061.88,-370.65 1061.88,-393.15 1100.88,-393.15 1100.88,-370.65 1061.88,-370.65"/>
-<text text-anchor="start" x="1064.88" y="-376.85" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-<polygon fill="lightgreen" stroke="none" points="1031.12,-348.15 1031.12,-370.65 1061.88,-370.65 1061.88,-348.15 1031.12,-348.15"/>
-<polygon fill="none" stroke="black" points="1031.12,-348.15 1031.12,-370.65 1061.88,-370.65 1061.88,-348.15 1031.12,-348.15"/>
-<text text-anchor="start" x="1034.12" y="-354.35" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_2" gradientUnits="userSpaceOnUse" x1="1067.59" y1="-367.36" x2="1095.16" y2="-351.45" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_2)" stroke="none" points="1061.88,-348.15 1061.88,-370.65 1100.88,-370.65 1100.88,-348.15 1061.88,-348.15"/>
-<polygon fill="none" stroke="black" points="1061.88,-348.15 1061.88,-370.65 1100.88,-370.65 1100.88,-348.15 1061.88,-348.15"/>
-<text text-anchor="start" x="1064.88" y="-354.35" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-</g>
-<!-- STRUCT_TOP->STRUCT_S2 -->
-<g id="edge38" class="edge">
-<title>STRUCT_TOP->STRUCT_S2</title>
-<path fill="none" stroke="black" d="M1001.53,-628.67C1012.68,-584.04 1041.67,-468.04 1056.68,-407.95"/>
-<polygon fill="black" stroke="black" points="1060,-409.09 1059.03,-398.54 1053.21,-407.39 1060,-409.09"/>
-</g>
-<!-- STRUCT_SN -->
-<g id="node28" class="node">
-<title>STRUCT_SN</title>
-<polygon fill="none" stroke="none" points="1237.88,-408.4 1152.12,-408.4 1152.12,-332.9 1237.88,-332.9 1237.88,-408.4"/>
-<polygon fill="lightgreen" stroke="none" points="1160.12,-381.9 1160.12,-404.4 1190.88,-404.4 1190.88,-381.9 1160.12,-381.9"/>
-<polygon fill="none" stroke="black" points="1160.12,-381.9 1160.12,-404.4 1190.88,-404.4 1190.88,-381.9 1160.12,-381.9"/>
-<text text-anchor="start" x="1163.12" y="-388.1" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_3" gradientUnits="userSpaceOnUse" x1="1196.59" y1="-401.11" x2="1224.16" y2="-385.2" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_3)" stroke="none" points="1190.88,-381.9 1190.88,-404.4 1229.88,-404.4 1229.88,-381.9 1190.88,-381.9"/>
-<polygon fill="none" stroke="black" points="1190.88,-381.9 1190.88,-404.4 1229.88,-404.4 1229.88,-381.9 1190.88,-381.9"/>
-<text text-anchor="start" x="1193.88" y="-388.1" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-<polygon fill="lightgreen" stroke="none" points="1160.12,-359.4 1160.12,-381.9 1190.88,-381.9 1190.88,-359.4 1160.12,-359.4"/>
-<polygon fill="none" stroke="black" points="1160.12,-359.4 1160.12,-381.9 1190.88,-381.9 1190.88,-359.4 1160.12,-359.4"/>
-<text text-anchor="start" x="1166.12" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">...  </text>
-<defs>
-<linearGradient id="l_4" gradientUnits="userSpaceOnUse" x1="1196.59" y1="-378.61" x2="1224.16" y2="-362.7" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_4)" stroke="none" points="1190.88,-359.4 1190.88,-381.9 1229.88,-381.9 1229.88,-359.4 1190.88,-359.4"/>
-<polygon fill="none" stroke="black" points="1190.88,-359.4 1190.88,-381.9 1229.88,-381.9 1229.88,-359.4 1190.88,-359.4"/>
-<text text-anchor="start" x="1193.88" y="-365.6" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-<polygon fill="lightgreen" stroke="none" points="1160.12,-336.9 1160.12,-359.4 1190.88,-359.4 1190.88,-336.9 1160.12,-336.9"/>
-<polygon fill="none" stroke="black" points="1160.12,-336.9 1160.12,-359.4 1190.88,-359.4 1190.88,-336.9 1160.12,-336.9"/>
-<text text-anchor="start" x="1163.12" y="-343.1" font-family="Times New Roman,serif" font-size="14.00">field</text>
-<defs>
-<linearGradient id="l_5" gradientUnits="userSpaceOnUse" x1="1196.59" y1="-356.11" x2="1224.16" y2="-340.2" >
-<stop offset="0" style="stop-color:lightblue;stop-opacity:1.;"/>
-<stop offset="1" style="stop-color:green;stop-opacity:1.;"/>
-</linearGradient>
-</defs>
-<polygon fill="url(#l_5)" stroke="none" points="1190.88,-336.9 1190.88,-359.4 1229.88,-359.4 1229.88,-336.9 1190.88,-336.9"/>
-<polygon fill="none" stroke="black" points="1190.88,-336.9 1190.88,-359.4 1229.88,-359.4 1229.88,-336.9 1190.88,-336.9"/>
-<text text-anchor="start" x="1193.88" y="-343.1" font-family="Times New Roman,serif" font-size="14.00">int/ptr</text>
-</g>
-<!-- STRUCT_TOP->STRUCT_SN -->
-<g id="edge39" class="edge">
-<title>STRUCT_TOP->STRUCT_SN</title>
-<path fill="none" stroke="black" d="M1009.69,-629.1C1039.89,-586.98 1116.85,-479.64 1161.52,-417.35"/>
-<polygon fill="black" stroke="black" points="1164.27,-419.52 1167.25,-409.35 1158.58,-415.44 1164.27,-419.52"/>
-</g>
-<!-- STRUCT_BOT -->
-<g id="node25" class="node">
-<title>STRUCT_BOT</title>
-<ellipse fill="lightgreen" stroke="black" cx="995" cy="-104.75" rx="44.7" ry="18"/>
-<text text-anchor="start" x="970.25" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="986" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:struct</text>
-</g>
-<!-- STRUCT_BOT->BOT -->
-<g id="edge43" class="edge">
-<title>STRUCT_BOT->BOT</title>
-<path fill="none" stroke="black" d="M967.59,-90.27C937.27,-75.36 888.65,-51.46 857.79,-36.28"/>
-<polygon fill="black" stroke="black" points="859.56,-33.25 849.04,-31.98 856.47,-39.53 859.56,-33.25"/>
-</g>
-<!-- STRUCT_S1->STRUCT_BOT -->
-<g id="edge40" class="edge">
-<title>STRUCT_S1->STRUCT_BOT</title>
-<path fill="none" stroke="black" d="M940.9,-352.79C950.72,-307.77 976.56,-189.3 988.62,-133.98"/>
-<polygon fill="black" stroke="black" points="992.01,-134.88 990.72,-124.36 985.17,-133.38 992.01,-134.88"/>
-</g>
-<!-- STRUCT_S1->STRUCT_S2 -->
-<!-- STRUCT_S2->STRUCT_BOT -->
-<g id="edge41" class="edge">
-<title>STRUCT_S2->STRUCT_BOT</title>
-<path fill="none" stroke="black" d="M1058.93,-344.18C1045.59,-294.22 1016.79,-186.34 1002.86,-134.18"/>
-<polygon fill="black" stroke="black" points="1006.24,-133.28 1000.28,-124.52 999.48,-135.08 1006.24,-133.28"/>
-</g>
-<!-- STRUCT_S2->STRUCT_SN -->
-<!-- STRUCT_SN->STRUCT_BOT -->
-<g id="edge42" class="edge">
-<title>STRUCT_SN->STRUCT_BOT</title>
-<path fill="none" stroke="black" d="M1166.77,-333.12C1125.77,-278.61 1050.75,-178.87 1014.99,-131.32"/>
-<polygon fill="black" stroke="black" points="1017.9,-129.37 1009.09,-123.48 1012.3,-133.58 1017.9,-129.37"/>
-</g>
-<!-- MEM_ALIAS1 -->
-<g id="node31" class="node">
-<title>MEM_ALIAS1</title>
-<ellipse fill="blue" stroke="black" cx="1301" cy="-370.65" rx="20.13" ry="20.13"/>
-<text text-anchor="middle" x="1301" y="-365.6" font-family="Times New Roman,serif" font-size="14.00" fill="white">#1</text>
-</g>
-<!-- MEM_TOP->MEM_ALIAS1 -->
-<g id="edge47" class="edge">
-<title>MEM_TOP->MEM_ALIAS1</title>
-<path fill="none" stroke="black" d="M1343.05,-628.67C1335.53,-582.52 1315.58,-460.09 1306.11,-402.04"/>
-<polygon fill="black" stroke="black" points="1309.57,-401.48 1304.51,-392.17 1302.66,-402.6 1309.57,-401.48"/>
-</g>
-<!-- MEM_ALIASDOTS -->
-<g id="node32" class="node">
-<title>MEM_ALIASDOTS</title>
-<ellipse fill="blue" stroke="black" cx="1391" cy="-370.65" rx="27" ry="18"/>
-<text text-anchor="middle" x="1391" y="-365.6" font-family="Times New Roman,serif" font-size="14.00" fill="white">...</text>
-</g>
-<!-- MEM_TOP->MEM_ALIASDOTS -->
-<g id="edge48" class="edge">
-<title>MEM_TOP->MEM_ALIASDOTS</title>
-<path fill="none" stroke="black" d="M1348.95,-628.67C1356.56,-581.96 1376.91,-457.11 1386.23,-399.95"/>
-<polygon fill="black" stroke="black" points="1389.64,-400.76 1387.79,-390.33 1382.73,-399.64 1389.64,-400.76"/>
-</g>
-<!-- MEM_ALIASN -->
-<g id="node33" class="node">
-<title>MEM_ALIASN</title>
-<ellipse fill="blue" stroke="black" cx="1481" cy="-370.65" rx="20.13" ry="20.13"/>
-<text text-anchor="middle" x="1481" y="-365.6" font-family="Times New Roman,serif" font-size="14.00" fill="white">#n</text>
-</g>
-<!-- MEM_TOP->MEM_ALIASN -->
-<g id="edge49" class="edge">
-<title>MEM_TOP->MEM_ALIASN</title>
-<path fill="none" stroke="black" d="M1354.86,-628.67C1377.84,-581.67 1439.5,-455.54 1467.2,-398.89"/>
-<polygon fill="black" stroke="black" points="1470.2,-400.72 1471.44,-390.2 1463.91,-397.64 1470.2,-400.72"/>
-</g>
-<!-- MEM_BOT -->
-<g id="node30" class="node">
-<title>MEM_BOT</title>
-<ellipse fill="blue" stroke="black" cx="1346" cy="-104.75" rx="43.67" ry="18"/>
-<text text-anchor="start" x="1322" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00" fill="white">⊥</text>
-<text text-anchor="start" x="1337.75" y="-100.7" font-family="Times New Roman,serif" font-size="14.00" fill="white">:mem</text>
-</g>
-<!-- MEM_BOT->BOT -->
-<g id="edge53" class="edge">
-<title>MEM_BOT->BOT</title>
-<path fill="none" stroke="black" d="M1305.86,-97.41C1206.64,-81.75 951.34,-41.44 861.15,-27.2"/>
-<polygon fill="black" stroke="black" points="861.94,-23.78 851.52,-25.68 860.85,-30.7 861.94,-23.78"/>
-</g>
-<!-- MEM_ALIAS1->MEM_BOT -->
-<g id="edge50" class="edge">
-<title>MEM_ALIAS1->MEM_BOT</title>
-<path fill="none" stroke="black" d="M1304.38,-350.67C1312.23,-304.29 1331.71,-189.17 1340.97,-134.49"/>
-<polygon fill="black" stroke="black" points="1344.41,-135.12 1342.63,-124.67 1337.51,-133.95 1344.41,-135.12"/>
-</g>
-<!-- MEM_ALIAS1->MEM_ALIASDOTS -->
-<!-- MEM_ALIASDOTS->MEM_BOT -->
-<g id="edge51" class="edge">
-<title>MEM_ALIASDOTS->MEM_BOT</title>
-<path fill="none" stroke="black" d="M1387.91,-352.38C1380.25,-307.12 1360.35,-189.52 1350.99,-134.26"/>
-<polygon fill="black" stroke="black" points="1354.49,-133.92 1349.37,-124.65 1347.58,-135.09 1354.49,-133.92"/>
-</g>
-<!-- MEM_ALIASDOTS->MEM_ALIASN -->
-<!-- MEM_ALIASN->MEM_BOT -->
-<g id="edge52" class="edge">
-<title>MEM_ALIASN->MEM_BOT</title>
-<path fill="none" stroke="black" d="M1471.72,-352.38C1448.54,-306.73 1388,-187.47 1360.26,-132.83"/>
-<polygon fill="black" stroke="black" points="1363.5,-131.48 1355.85,-124.15 1357.26,-134.65 1363.5,-131.48"/>
-</g>
-<!-- TUPLE1 -->
-<g id="node36" class="node">
-<title>TUPLE1</title>
-<polygon fill="none" stroke="none" points="1598,-397.15 1544,-397.15 1544,-344.15 1598,-344.15 1598,-397.15"/>
-<polygon fill="pink" stroke="none" points="1552.25,-370.65 1552.25,-393.15 1589.75,-393.15 1589.75,-370.65 1552.25,-370.65"/>
-<polygon fill="none" stroke="black" points="1552.25,-370.65 1552.25,-393.15 1589.75,-393.15 1589.75,-370.65 1552.25,-370.65"/>
-<text text-anchor="start" x="1555.25" y="-376.85" font-family="Times New Roman,serif" font-size="14.00">Tuple</text>
-<polygon fill="black" stroke="none" points="1552.25,-348.15 1552.25,-370.65 1589.75,-370.65 1589.75,-348.15 1552.25,-348.15"/>
-<polygon fill="none" stroke="black" points="1552.25,-348.15 1552.25,-370.65 1589.75,-370.65 1589.75,-348.15 1552.25,-348.15"/>
-<text text-anchor="start" x="1559.38" y="-354.35" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-</g>
-<!-- TUPLE_TOP->TUPLE1 -->
-<g id="edge57" class="edge">
-<title>TUPLE_TOP->TUPLE1</title>
-<path fill="none" stroke="black" d="M1615.85,-628.67C1608.11,-584.13 1588.01,-468.52 1577.55,-408.33"/>
-<polygon fill="black" stroke="black" points="1581.01,-407.81 1575.85,-398.56 1574.12,-409.01 1581.01,-407.81"/>
-</g>
-<!-- TUPLE2 -->
-<g id="node37" class="node">
-<title>TUPLE2</title>
-<polygon fill="none" stroke="none" points="1695,-408.4 1641,-408.4 1641,-332.9 1695,-332.9 1695,-408.4"/>
-<polygon fill="pink" stroke="none" points="1649.25,-381.9 1649.25,-404.4 1686.75,-404.4 1686.75,-381.9 1649.25,-381.9"/>
-<polygon fill="none" stroke="black" points="1649.25,-381.9 1649.25,-404.4 1686.75,-404.4 1686.75,-381.9 1649.25,-381.9"/>
-<text text-anchor="start" x="1652.25" y="-388.1" font-family="Times New Roman,serif" font-size="14.00">Tuple</text>
-<polygon fill="black" stroke="none" points="1649.25,-359.4 1649.25,-381.9 1686.75,-381.9 1686.75,-359.4 1649.25,-359.4"/>
-<polygon fill="none" stroke="black" points="1649.25,-359.4 1649.25,-381.9 1686.75,-381.9 1686.75,-359.4 1649.25,-359.4"/>
-<text text-anchor="start" x="1656.38" y="-365.6" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-<polygon fill="black" stroke="none" points="1649.25,-336.9 1649.25,-359.4 1686.75,-359.4 1686.75,-336.9 1649.25,-336.9"/>
-<polygon fill="none" stroke="black" points="1649.25,-336.9 1649.25,-359.4 1686.75,-359.4 1686.75,-336.9 1649.25,-336.9"/>
-<text text-anchor="start" x="1656.38" y="-343.1" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-</g>
-<!-- TUPLE_TOP->TUPLE2 -->
-<g id="edge58" class="edge">
-<title>TUPLE_TOP->TUPLE2</title>
-<path fill="none" stroke="black" d="M1622.22,-628.67C1629.67,-586.65 1648.35,-481.4 1659.41,-419.08"/>
-<polygon fill="black" stroke="black" points="1662.81,-419.91 1661.11,-409.46 1655.92,-418.69 1662.81,-419.91"/>
-</g>
-<!-- TUPLEN -->
-<g id="node38" class="node">
-<title>TUPLEN</title>
-<polygon fill="none" stroke="none" points="1792,-419.65 1738,-419.65 1738,-321.65 1792,-321.65 1792,-419.65"/>
-<polygon fill="pink" stroke="none" points="1746.25,-393.15 1746.25,-415.65 1783.75,-415.65 1783.75,-393.15 1746.25,-393.15"/>
-<polygon fill="none" stroke="black" points="1746.25,-393.15 1746.25,-415.65 1783.75,-415.65 1783.75,-393.15 1746.25,-393.15"/>
-<text text-anchor="start" x="1749.25" y="-399.35" font-family="Times New Roman,serif" font-size="14.00">Tuple</text>
-<polygon fill="black" stroke="none" points="1746.25,-370.65 1746.25,-393.15 1783.75,-393.15 1783.75,-370.65 1746.25,-370.65"/>
-<polygon fill="none" stroke="black" points="1746.25,-370.65 1746.25,-393.15 1783.75,-393.15 1783.75,-370.65 1746.25,-370.65"/>
-<text text-anchor="start" x="1753.38" y="-376.85" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-<polygon fill="black" stroke="none" points="1746.25,-348.15 1746.25,-370.65 1783.75,-370.65 1783.75,-348.15 1746.25,-348.15"/>
-<polygon fill="none" stroke="black" points="1746.25,-348.15 1746.25,-370.65 1783.75,-370.65 1783.75,-348.15 1746.25,-348.15"/>
-<text text-anchor="start" x="1759.38" y="-354.35" font-family="Times New Roman,serif" font-size="14.00" fill="white">...</text>
-<polygon fill="black" stroke="none" points="1746.25,-325.65 1746.25,-348.15 1783.75,-348.15 1783.75,-325.65 1746.25,-325.65"/>
-<polygon fill="none" stroke="black" points="1746.25,-325.65 1746.25,-348.15 1783.75,-348.15 1783.75,-325.65 1746.25,-325.65"/>
-<text text-anchor="start" x="1753.38" y="-331.85" font-family="Times New Roman,serif" font-size="14.00" fill="white">type</text>
-</g>
-<!-- TUPLE_TOP->TUPLEN -->
-<g id="edge59" class="edge">
-<title>TUPLE_TOP->TUPLEN</title>
-<path fill="none" stroke="black" d="M1628.36,-629.1C1649.26,-589.55 1700.57,-492.51 1734.02,-429.24"/>
-<polygon fill="black" stroke="black" points="1736.95,-431.2 1738.53,-420.73 1730.76,-427.93 1736.95,-431.2"/>
-</g>
-<!-- TUPLE_BOT -->
-<g id="node35" class="node">
-<title>TUPLE_BOT</title>
-<ellipse fill="pink" stroke="black" cx="1619" cy="-104.75" rx="42.65" ry="18"/>
-<text text-anchor="start" x="1595.75" y="-100.7" font-family="Times New Roman,serif" font-weight="bold" font-size="14.00">⊥</text>
-<text text-anchor="start" x="1611.5" y="-100.7" font-family="Times New Roman,serif" font-size="14.00">:tuple</text>
-</g>
-<!-- TUPLE_BOT->BOT -->
-<g id="edge63" class="edge">
-<title>TUPLE_BOT->BOT</title>
-<path fill="none" stroke="black" d="M1577.91,-99.5C1438.76,-85.13 986.93,-38.44 861.54,-25.49"/>
-<polygon fill="black" stroke="black" points="861.93,-22.01 851.62,-24.46 861.21,-28.97 861.93,-22.01"/>
-</g>
-<!-- TUPLE1->TUPLE_BOT -->
-<g id="edge60" class="edge">
-<title>TUPLE1->TUPLE_BOT</title>
-<path fill="none" stroke="black" d="M1575.78,-344.18C1584.8,-294.22 1604.27,-186.34 1613.69,-134.18"/>
-<polygon fill="black" stroke="black" points="1617.09,-135.01 1615.43,-124.55 1610.21,-133.77 1617.09,-135.01"/>
-</g>
-<!-- TUPLE2->TUPLE_BOT -->
-<g id="edge61" class="edge">
-<title>TUPLE2->TUPLE_BOT</title>
-<path fill="none" stroke="black" d="M1661.08,-333.12C1651.23,-279.67 1633.37,-182.73 1624.42,-134.16"/>
-<polygon fill="black" stroke="black" points="1627.87,-133.59 1622.62,-124.39 1620.99,-134.86 1627.87,-133.59"/>
-</g>
-<!-- TUPLEN->TUPLE_BOT -->
-<g id="edge62" class="edge">
-<title>TUPLEN->TUPLE_BOT</title>
-<path fill="none" stroke="black" d="M1738.22,-321.88C1707.66,-266.22 1658.74,-177.12 1634.15,-132.34"/>
-<polygon fill="black" stroke="black" points="1637.34,-130.87 1629.45,-123.79 1631.2,-134.24 1637.34,-130.87"/>
-</g>
-</g>
-</svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Generated by graphviz version 12.2.0 (20241103.1931) + --> +<!-- Title: Lattice Pages: 1 --> +<svg width="2287pt" height="811pt" + viewBox="0.00 0.00 2287.00 810.78" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 806.78)"> +<title>Lattice</title> +<polygon fill="white" stroke="none" points="-4,4 -4,-806.78 2283,-806.78 2283,4 -4,4"/> +<g id="clust1" class="cluster"> +<title>cluster_control</title> +<polygon fill="none" stroke="#cccccc" points="8,-85.99 8,-732.04 98,-732.04 98,-85.99 8,-85.99"/> +<text text-anchor="middle" x="53" y="-714.74" font-family="Arial" font-size="14.00">Control</text> +</g> +<g id="clust2" class="cluster"> +<title>cluster_integer</title> +<polygon fill="none" stroke="#cccccc" points="106,-85.99 106,-732.04 372,-732.04 372,-85.99 106,-85.99"/> +<text text-anchor="middle" x="239" y="-714.74" font-family="Arial" font-size="14.00">Integer ranges (schematic)</text> +</g> +<g id="clust4" class="cluster"> +<title>cluster_float</title> +<polygon fill="none" stroke="#cccccc" points="380,-85.99 380,-732.04 864,-732.04 864,-85.99 380,-85.99"/> +<text text-anchor="middle" x="622" y="-714.74" font-family="Arial" font-size="14.00">Float</text> +</g> +<g id="clust6" class="cluster"> +<title>cluster_pointer</title> +<polygon fill="none" stroke="#cccccc" points="872,-75 872,-743.03 1353,-743.03 1353,-75 872,-75"/> +<text text-anchor="middle" x="1112.5" y="-725.73" font-family="Arial" font-size="14.00">Pointer = nullability × struct type</text> +</g> +<g id="clust13" class="cluster"> +<title>cluster_struct</title> +<polygon fill="none" stroke="#cccccc" points="1361,-75 1361,-758.78 1697,-758.78 1697,-75 1361,-75"/> +<text text-anchor="middle" x="1529" y="-741.48" font-family="Arial" font-size="14.00">Struct</text> +<text text-anchor="middle" x="1529" y="-725.73" font-family="Arial" font-size="14.00">named collection of named scalar types</text> +</g> +<g id="clust17" class="cluster"> +<title>cluster_memory</title> +<polygon fill="none" stroke="#cccccc" points="1705,-85.99 1705,-747.79 1987,-747.79 1987,-85.99 1705,-85.99"/> +<text text-anchor="middle" x="1846" y="-730.49" font-family="Arial" font-size="14.00">Memory</text> +<text text-anchor="middle" x="1846" y="-714.74" font-family="Arial" font-size="14.00">precise alias slices</text> +</g> +<g id="clust21" class="cluster"> +<title>cluster_tuple</title> +<polygon fill="none" stroke="#cccccc" points="1995,-85.99 1995,-747.79 2271,-747.79 2271,-85.99 1995,-85.99"/> +<text text-anchor="middle" x="2133" y="-730.49" font-family="Arial" font-size="14.00">Tuple</text> +<text text-anchor="middle" x="2133" y="-714.74" font-family="Arial" font-size="14.00">collection of types</text> +</g> +<!-- TOP --> +<g id="node1" class="node"> +<title>TOP</title> +<ellipse fill="black" stroke="black" cx="1093" cy="-784.78" rx="27" ry="18"/> +<text text-anchor="middle" x="1093" y="-780.68" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤</text> +</g> +<!-- XCTRL --> +<g id="node3" class="node"> +<title>XCTRL</title> +<ellipse fill="#ffff00" stroke="black" cx="53" cy="-682.29" rx="36.51" ry="18"/> +<text text-anchor="middle" x="53" y="-678.19" font-family="DejaVu Sans" font-size="13.00">⊤:ctrl</text> +</g> +<!-- TOP->XCTRL --> +<g id="edge77" class="edge"> +<title>TOP->XCTRL</title> +<path fill="none" stroke="#555555" d="M1065.75,-783.81C910.7,-783.87 145.18,-782.94 102,-758.78 82.14,-747.67 69.01,-724.76 61.39,-707.08"/> +<polygon fill="#555555" stroke="#555555" points="63.43,-706.52 59.22,-701.76 59.54,-708.1 63.43,-706.52"/> +</g> +<!-- INT_TOP --> +<g id="node5" class="node"> +<title>INT_TOP</title> +<ellipse fill="lightblue" stroke="black" cx="330" cy="-682.29" rx="33.95" ry="18"/> +<text text-anchor="start" x="313.12" y="-679.19" font-family="DejaVu Sans" font-weight="bold" font-size="13.00">⊤</text> +<text text-anchor="start" x="325.12" y="-679.19" font-family="DejaVu Sans" font-size="13.00">:int</text> +</g> +<!-- TOP->INT_TOP --> +<g id="edge78" class="edge"> +<title>TOP->INT_TOP</title> +<path fill="none" stroke="#555555" d="M1065.76,-783.55C938.37,-782.39 406.27,-776.49 376,-758.78 356.7,-747.5 344.47,-724.61 337.51,-706.98"/> +<polygon fill="#555555" stroke="#555555" points="339.61,-706.59 335.55,-701.7 335.67,-708.05 339.61,-706.59"/> +</g> +<!-- FLT_TOP --> +<g id="node14" class="node"> +<title>FLT_TOP</title> +<ellipse fill="aqua" stroke="black" cx="720" cy="-682.29" rx="31.39" ry="18"/> +<text text-anchor="start" x="705" y="-679.19" font-family="DejaVu Sans" font-weight="bold" font-size="13.00">⊤</text> +<text text-anchor="start" x="717" y="-679.19" font-family="DejaVu Sans" font-size="13.00">:flt</text> +</g> +<!-- TOP->FLT_TOP --> +<g id="edge79" class="edge"> +<title>TOP->FLT_TOP</title> +<path fill="none" stroke="#555555" d="M1065.71,-783.88C1022.73,-783.35 937.09,-779.49 868,-758.78 822.79,-745.23 774.91,-718.16 746.24,-700.39"/> +<polygon fill="#555555" stroke="#555555" points="747.56,-698.74 741.36,-697.33 745.33,-702.3 747.56,-698.74"/> +</g> +<!-- PTR_TOP --> +<g id="node22" class="node"> +<title>PTR_TOP</title> +<ellipse fill="#008000" stroke="black" cx="1093" cy="-682.29" rx="61.7" ry="28.99"/> +<text text-anchor="middle" x="1093" y="-686.44" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:ptr</text> +<text text-anchor="middle" x="1093" y="-669.94" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊤:struct]</text> +</g> +<!-- TOP->PTR_TOP --> +<g id="edge80" class="edge"> +<title>TOP->PTR_TOP</title> +<path fill="none" stroke="#555555" d="M1093,-766.74C1093,-753.62 1093,-735.05 1093,-718.76"/> +<polygon fill="#555555" stroke="#555555" points="1095.1,-718.97 1093,-712.97 1090.9,-718.97 1095.1,-718.97"/> +</g> +<!-- STRUCT_TOP --> +<g id="node32" class="node"> +<title>STRUCT_TOP</title> +<ellipse fill="#90ee90" stroke="black" cx="1480" cy="-682.29" rx="64.35" ry="28.99"/> +<text text-anchor="middle" x="1480" y="-686.44" font-family="DejaVu Sans" font-size="13.00">⊤:struct</text> +<text text-anchor="middle" x="1480" y="-669.94" font-family="DejaVu Sans" font-size="13.00">[struct top]</text> +</g> +<!-- TOP->STRUCT_TOP --> +<g id="edge81" class="edge"> +<title>TOP->STRUCT_TOP</title> +<path fill="none" stroke="#555555" d="M1119.97,-782.78C1178.13,-780.35 1313.55,-773.3 1357,-758.78 1388.2,-748.36 1419.74,-728.78 1443.07,-712.17"/> +<polygon fill="#555555" stroke="#555555" points="1444.26,-713.9 1447.9,-708.68 1441.8,-710.49 1444.26,-713.9"/> +</g> +<!-- MEM_TOP --> +<g id="node38" class="node"> +<title>MEM_TOP</title> +<ellipse fill="#00008b" stroke="black" cx="1807" cy="-682.29" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1807" y="-678.19" font-family="DejaVu Sans" font-size="13.00" fill="white">⊤:mem</text> +</g> +<!-- TOP->MEM_TOP --> +<g id="edge82" class="edge"> +<title>TOP->MEM_TOP</title> +<path fill="none" stroke="#555555" d="M1120.14,-783.58C1230.92,-782.61 1645.66,-777.74 1701,-758.78 1734.02,-747.47 1765.78,-722.33 1785.79,-704.16"/> +<polygon fill="#555555" stroke="#555555" points="1787.02,-705.88 1790,-700.26 1784.17,-702.8 1787.02,-705.88"/> +</g> +<!-- TUPLE_TOP --> +<g id="node43" class="node"> +<title>TUPLE_TOP</title> +<ellipse fill="#ffc0cb" stroke="black" cx="2048" cy="-682.29" rx="44.7" ry="18"/> +<text text-anchor="middle" x="2048" y="-678.19" font-family="DejaVu Sans" font-size="13.00">⊤:tuple</text> +</g> +<!-- TOP->TUPLE_TOP --> +<g id="edge83" class="edge"> +<title>TOP->TUPLE_TOP</title> +<path fill="none" stroke="#555555" d="M1120.01,-783.69C1265.56,-783.09 1951.36,-779.22 1991,-758.78 2012.45,-747.73 2028.06,-724.49 2037.46,-706.7"/> +<polygon fill="#555555" stroke="#555555" points="2039.12,-708.07 2039.96,-701.77 2035.37,-706.17 2039.12,-708.07"/> +</g> +<!-- BOT --> +<g id="node2" class="node"> +<title>BOT</title> +<ellipse fill="black" stroke="black" cx="1158" cy="-18" rx="27" ry="18"/> +<text text-anchor="middle" x="1158" y="-13.9" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥</text> +</g> +<!-- CTRL --> +<g id="node4" class="node"> +<title>CTRL</title> +<ellipse fill="#ffff00" stroke="black" cx="53" cy="-111.99" rx="36.51" ry="18"/> +<text text-anchor="middle" x="53" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:ctrl</text> +</g> +<!-- XCTRL->CTRL --> +<g id="edge1" class="edge"> +<title>XCTRL->CTRL</title> +<path fill="none" stroke="#555555" d="M53,-663.84C53,-629.39 53,-550.21 53,-483.64 53,-483.64 53,-483.64 53,-292.98 53,-237.49 53,-172.38 53,-137.7"/> +<polygon fill="#555555" stroke="#555555" points="55.1,-137.88 53,-131.88 50.9,-137.88 55.1,-137.88"/> +</g> +<!-- XCTRL->INT_TOP --> +<!-- CTRL->BOT --> +<g id="edge84" class="edge"> +<title>CTRL->BOT</title> +<path fill="none" stroke="#555555" d="M68.82,-95.67C77.79,-87.99 89.68,-79.4 102,-75 199.9,-40.01 951.33,-23.1 1123.11,-19.66"/> +<polygon fill="#555555" stroke="#555555" points="1123.14,-21.76 1129.1,-19.55 1123.06,-17.57 1123.14,-21.76"/> +</g> +<!-- INT_HI --> +<g id="node7" class="node"> +<title>INT_HI</title> +<ellipse fill="lightblue" stroke="black" cx="303" cy="-588.3" rx="61.08" ry="18"/> +<text text-anchor="middle" x="303" y="-584.2" font-family="DejaVu Sans" font-size="13.00">max < min</text> +</g> +<!-- INT_TOP->INT_HI --> +<g id="edge2" class="edge"> +<title>INT_TOP->INT_HI</title> +<path fill="none" stroke="#555555" d="M325.05,-664.42C320.88,-650.2 314.85,-629.69 310.16,-613.69"/> +<polygon fill="#555555" stroke="#555555" points="312.24,-613.31 308.53,-608.14 308.21,-614.49 312.24,-613.31"/> +</g> +<!-- INT_TOP->FLT_TOP --> +<!-- INT_BOT --> +<g id="node6" class="node"> +<title>INT_BOT</title> +<ellipse fill="lightblue" stroke="black" cx="316" cy="-111.99" rx="33.95" ry="18"/> +<text text-anchor="start" x="299.12" y="-108.89" font-family="DejaVu Sans" font-weight="bold" font-size="13.00">⊥</text> +<text text-anchor="start" x="311.12" y="-108.89" font-family="DejaVu Sans" font-size="13.00">:int</text> +</g> +<!-- INT_BOT->BOT --> +<g id="edge85" class="edge"> +<title>INT_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M334.62,-96.69C345.94,-88.82 361.06,-79.72 376,-75 518.37,-30.04 991.01,-21.01 1123.31,-19.35"/> +<polygon fill="#555555" stroke="#555555" points="1123.32,-21.45 1129.3,-19.28 1123.27,-17.25 1123.32,-21.45"/> +</g> +<!-- INT_XBOOL --> +<g id="node8" class="node"> +<title>INT_XBOOL</title> +<ellipse fill="lightblue" stroke="black" cx="211" cy="-482.64" rx="31.39" ry="18"/> +<text text-anchor="middle" x="211" y="-478.54" font-family="DejaVu Sans" font-size="13.00">1...0</text> +</g> +<!-- INT_HI->INT_XBOOL --> +<g id="edge3" class="edge"> +<title>INT_HI->INT_XBOOL</title> +<path fill="none" stroke="#555555" d="M288.22,-570.65C272.25,-552.65 246.77,-523.94 229.48,-504.47"/> +<polygon fill="#555555" stroke="#555555" points="231.4,-503.46 225.85,-500.37 228.26,-506.25 231.4,-503.46"/> +</g> +<!-- INT_CON --> +<g id="node9" class="node"> +<title>INT_CON</title> +<ellipse fill="lightblue" stroke="black" cx="309" cy="-376.98" rx="54.93" ry="18"/> +<text text-anchor="middle" x="309" y="-372.88" font-family="DejaVu Sans" font-size="13.00">constants</text> +</g> +<!-- INT_HI->INT_CON --> +<g id="edge6" class="edge"> +<title>INT_HI->INT_CON</title> +<path fill="none" stroke="#555555" d="M303.5,-569.81C304.57,-532.63 307.06,-445.61 308.29,-402.74"/> +<polygon fill="#555555" stroke="#555555" points="310.39,-402.84 308.46,-396.78 306.19,-402.72 310.39,-402.84"/> +</g> +<!-- INT_CON0 --> +<g id="node10" class="node"> +<title>INT_CON0</title> +<ellipse fill="lightblue" stroke="black" cx="141" cy="-376.98" rx="27" ry="18"/> +<text text-anchor="middle" x="141" y="-372.88" font-family="DejaVu Sans" font-size="13.00">0</text> +</g> +<!-- INT_XBOOL->INT_CON0 --> +<g id="edge4" class="edge"> +<title>INT_XBOOL->INT_CON0</title> +<path fill="none" stroke="#555555" d="M200.06,-465.44C188.13,-447.77 168.95,-419.38 155.71,-399.76"/> +<polygon fill="#555555" stroke="#555555" points="157.58,-398.78 152.48,-394.98 154.1,-401.13 157.58,-398.78"/> +</g> +<!-- INT_CON1 --> +<g id="node11" class="node"> +<title>INT_CON1</title> +<ellipse fill="lightblue" stroke="black" cx="211" cy="-376.98" rx="27" ry="18"/> +<text text-anchor="middle" x="211" y="-372.88" font-family="DejaVu Sans" font-size="13.00">1</text> +</g> +<!-- INT_XBOOL->INT_CON1 --> +<g id="edge5" class="edge"> +<title>INT_XBOOL->INT_CON1</title> +<path fill="none" stroke="#555555" d="M211,-464.52C211,-447.74 211,-421.98 211,-402.93"/> +<polygon fill="#555555" stroke="#555555" points="213.1,-402.99 211,-396.99 208.9,-402.99 213.1,-402.99"/> +</g> +<!-- INT_LO --> +<g id="node13" class="node"> +<title>INT_LO</title> +<ellipse fill="lightblue" stroke="black" cx="303" cy="-208.48" rx="61.08" ry="18"/> +<text text-anchor="middle" x="303" y="-204.38" font-family="DejaVu Sans" font-size="13.00">max > min</text> +</g> +<!-- INT_CON->INT_LO --> +<g id="edge10" class="edge"> +<title>INT_CON->INT_LO</title> +<path fill="none" stroke="#555555" d="M308.38,-358.79C307.31,-329.13 305.12,-268.24 303.89,-234.09"/> +<polygon fill="#555555" stroke="#555555" points="305.99,-234.26 303.68,-228.34 301.8,-234.41 305.99,-234.26"/> +</g> +<!-- INT_CON0->INT_CON1 --> +<!-- INT_BOOL --> +<g id="node12" class="node"> +<title>INT_BOOL</title> +<ellipse fill="lightblue" stroke="black" cx="211" cy="-293.98" rx="31.39" ry="18"/> +<text text-anchor="middle" x="211" y="-289.88" font-family="DejaVu Sans" font-size="13.00">0...1</text> +</g> +<!-- INT_CON0->INT_BOOL --> +<g id="edge7" class="edge"> +<title>INT_CON0->INT_BOOL</title> +<path fill="none" stroke="#555555" d="M154.17,-360.75C165.07,-348.12 180.69,-330.05 192.8,-316.04"/> +<polygon fill="#555555" stroke="#555555" points="194.09,-317.76 196.43,-311.85 190.91,-315.01 194.09,-317.76"/> +</g> +<!-- INT_CON1->INT_CON --> +<!-- INT_CON1->INT_BOOL --> +<g id="edge8" class="edge"> +<title>INT_CON1->INT_BOOL</title> +<path fill="none" stroke="#555555" d="M211,-358.8C211,-347.5 211,-332.51 211,-319.9"/> +<polygon fill="#555555" stroke="#555555" points="213.1,-319.93 211,-313.93 208.9,-319.93 213.1,-319.93"/> +</g> +<!-- INT_BOOL->INT_LO --> +<g id="edge9" class="edge"> +<title>INT_BOOL->INT_LO</title> +<path fill="none" stroke="#555555" d="M227.03,-278.44C241.55,-265.26 263.13,-245.67 279.59,-230.73"/> +<polygon fill="#555555" stroke="#555555" points="280.8,-232.47 283.83,-226.88 277.98,-229.36 280.8,-232.47"/> +</g> +<!-- INT_LO->INT_BOT --> +<g id="edge11" class="edge"> +<title>INT_LO->INT_BOT</title> +<path fill="none" stroke="#555555" d="M305.38,-190.15C307.42,-175.37 310.37,-153.94 312.64,-137.42"/> +<polygon fill="#555555" stroke="#555555" points="314.69,-137.94 313.42,-131.71 310.53,-137.37 314.69,-137.94"/> +</g> +<!-- FLT_CON64 --> +<g id="node16" class="node"> +<title>FLT_CON64</title> +<ellipse fill="aqua" stroke="black" cx="790" cy="-482.64" rx="65.94" ry="40.66"/> +<text text-anchor="middle" x="790" y="-495.04" font-family="DejaVu Sans" font-size="13.00">64b consts</text> +<text text-anchor="middle" x="790" y="-478.54" font-family="DejaVu Sans" font-size="13.00">[excludes</text> +<text text-anchor="middle" x="790" y="-462.04" font-family="DejaVu Sans" font-size="13.00">32b consts]</text> +</g> +<!-- FLT_TOP->FLT_CON64 --> +<g id="edge14" class="edge"> +<title>FLT_TOP->FLT_CON64</title> +<path fill="none" stroke="#555555" d="M725.97,-664.44C736.43,-634.9 758.41,-572.83 773.68,-529.71"/> +<polygon fill="#555555" stroke="#555555" points="775.64,-530.48 775.66,-524.12 771.68,-529.08 775.64,-530.48"/> +</g> +<!-- FLT_CONPI --> +<g id="node18" class="node"> +<title>FLT_CONPI</title> +<ellipse fill="aqua" stroke="black" cx="651" cy="-482.64" rx="56.98" ry="18"/> +<text text-anchor="middle" x="651" y="-478.54" font-family="DejaVu Sans" font-size="13.00">3.14159...</text> +</g> +<!-- FLT_TOP->FLT_CONPI --> +<g id="edge15" class="edge"> +<title>FLT_TOP->FLT_CONPI</title> +<path fill="none" stroke="#555555" d="M714.12,-664.44C701.88,-629.39 673.65,-548.52 659.46,-507.88"/> +<polygon fill="#555555" stroke="#555555" points="661.52,-507.42 657.56,-502.44 657.56,-508.8 661.52,-507.42"/> +</g> +<!-- FLT_X32 --> +<g id="node19" class="node"> +<title>FLT_X32</title> +<ellipse fill="aqua" stroke="black" cx="518" cy="-588.3" rx="32.93" ry="18"/> +<text text-anchor="middle" x="518" y="-584.2" font-family="DejaVu Sans" font-size="13.00">~f32</text> +</g> +<!-- FLT_TOP->FLT_X32 --> +<g id="edge18" class="edge"> +<title>FLT_TOP->FLT_X32</title> +<path fill="none" stroke="#555555" d="M696.03,-670.38C659.58,-653.78 590.16,-622.16 549.62,-603.7"/> +<polygon fill="#555555" stroke="#555555" points="550.59,-601.83 544.26,-601.26 548.85,-605.66 550.59,-601.83"/> +</g> +<!-- FLT_TOP->PTR_TOP --> +<!-- FLT_BOT --> +<g id="node15" class="node"> +<title>FLT_BOT</title> +<ellipse fill="aqua" stroke="black" cx="720" cy="-111.99" rx="31.39" ry="18"/> +<text text-anchor="start" x="705" y="-108.89" font-family="DejaVu Sans" font-weight="bold" font-size="13.00">⊥</text> +<text text-anchor="start" x="717" y="-108.89" font-family="DejaVu Sans" font-size="13.00">:flt</text> +</g> +<!-- FLT_BOT->BOT --> +<g id="edge86" class="edge"> +<title>FLT_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M748.28,-103.69C778,-96.11 826.14,-84.12 868,-75 960.59,-54.81 1070.63,-34.59 1124.67,-24.9"/> +<polygon fill="#555555" stroke="#555555" points="1124.89,-26.99 1130.43,-23.87 1124.15,-22.86 1124.89,-26.99"/> +</g> +<!-- FLT_CON64->FLT_BOT --> +<g id="edge16" class="edge"> +<title>FLT_CON64->FLT_BOT</title> +<path fill="none" stroke="#555555" d="M782.44,-441.84C767.9,-365.27 736.43,-199.52 724.61,-137.27"/> +<polygon fill="#555555" stroke="#555555" points="726.73,-137.2 723.55,-131.69 722.61,-137.98 726.73,-137.2"/> +</g> +<!-- FLT_CON32 --> +<g id="node17" class="node"> +<title>FLT_CON32</title> +<ellipse fill="aqua" stroke="black" cx="518" cy="-482.64" rx="60.05" ry="18"/> +<text text-anchor="middle" x="518" y="-478.54" font-family="DejaVu Sans" font-size="13.00">32b consts</text> +</g> +<!-- FLT_CON32->FLT_CONPI --> +<!-- FLT_32 --> +<g id="node21" class="node"> +<title>FLT_32</title> +<ellipse fill="aqua" stroke="black" cx="518" cy="-376.98" rx="27" ry="18"/> +<text text-anchor="middle" x="518" y="-372.88" font-family="DejaVu Sans" font-size="13.00">f32</text> +</g> +<!-- FLT_CON32->FLT_32 --> +<g id="edge22" class="edge"> +<title>FLT_CON32->FLT_32</title> +<path fill="none" stroke="#555555" d="M518,-464.52C518,-447.74 518,-421.98 518,-402.93"/> +<polygon fill="#555555" stroke="#555555" points="520.1,-402.99 518,-396.99 515.9,-402.99 520.1,-402.99"/> +</g> +<!-- FLT_CONPI->FLT_BOT --> +<g id="edge17" class="edge"> +<title>FLT_CONPI->FLT_BOT</title> +<path fill="none" stroke="#555555" d="M654.24,-464.36C665.42,-404.61 702.46,-206.71 715.45,-137.3"/> +<polygon fill="#555555" stroke="#555555" points="717.45,-138.01 716.49,-131.73 713.32,-137.24 717.45,-138.01"/> +</g> +<!-- FLT_CONPI->FLT_CON64 --> +<!-- FLT_X32->FLT_CON32 --> +<g id="edge20" class="edge"> +<title>FLT_X32->FLT_CON32</title> +<path fill="none" stroke="#555555" d="M518,-570.18C518,-553.4 518,-527.64 518,-508.58"/> +<polygon fill="#555555" stroke="#555555" points="520.1,-508.64 518,-502.64 515.9,-508.64 520.1,-508.64"/> +</g> +<!-- FLT_CON0 --> +<g id="node20" class="node"> +<title>FLT_CON0</title> +<ellipse fill="aqua" stroke="black" cx="415" cy="-482.64" rx="27" ry="18"/> +<text text-anchor="middle" x="415" y="-478.54" font-family="DejaVu Sans" font-size="13.00">0.</text> +</g> +<!-- FLT_X32->FLT_CON0 --> +<g id="edge19" class="edge"> +<title>FLT_X32->FLT_CON0</title> +<path fill="none" stroke="#555555" d="M501.38,-572.45C487.36,-559.74 466.92,-540.77 450,-523.3 444.13,-517.24 437.97,-510.42 432.47,-504.17"/> +<polygon fill="#555555" stroke="#555555" points="434.16,-502.91 428.64,-499.77 431,-505.67 434.16,-502.91"/> +</g> +<!-- FLT_CON0->FLT_CON32 --> +<!-- FLT_CON0->FLT_32 --> +<g id="edge21" class="edge"> +<title>FLT_CON0->FLT_32</title> +<path fill="none" stroke="#555555" d="M427.65,-466.66C434.16,-459.11 442.33,-449.9 450,-441.98 465.23,-426.25 483.32,-409.31 497.01,-396.8"/> +<polygon fill="#555555" stroke="#555555" points="498.07,-398.68 501.09,-393.09 495.24,-395.57 498.07,-398.68"/> +</g> +<!-- FLT_32->FLT_BOT --> +<g id="edge23" class="edge"> +<title>FLT_32->FLT_BOT</title> +<path fill="none" stroke="#555555" d="M529.73,-360.71C563.88,-316.25 663.29,-186.82 703.16,-134.91"/> +<polygon fill="#555555" stroke="#555555" points="704.81,-136.21 706.8,-130.17 701.48,-133.65 704.81,-136.21"/> +</g> +<!-- PTR_NULL --> +<g id="node24" class="node"> +<title>PTR_NULL</title> +<ellipse fill="#008000" stroke="black" cx="1219" cy="-588.3" rx="27.3" ry="18"/> +<text text-anchor="middle" x="1219" y="-584.2" font-family="DejaVu Sans" font-size="13.00" fill="white">null</text> +</g> +<!-- PTR_TOP->PTR_NULL --> +<g id="edge33" class="edge"> +<title>PTR_TOP->PTR_NULL</title> +<path fill="none" stroke="#555555" d="M1125.78,-657.36C1147.49,-641.51 1175.48,-621.07 1195.1,-606.75"/> +<polygon fill="#555555" stroke="#555555" points="1196.33,-608.45 1199.93,-603.22 1193.85,-605.06 1196.33,-608.45"/> +</g> +<!-- PTR_PERSON --> +<g id="node26" class="node"> +<title>PTR_PERSON</title> +<ellipse fill="#008000" stroke="black" cx="962" cy="-588.3" rx="45.72" ry="18"/> +<text text-anchor="middle" x="962" y="-584.2" font-family="DejaVu Sans" font-size="13.00" fill="white">*Person</text> +</g> +<!-- PTR_TOP->PTR_PERSON --> +<g id="edge34" class="edge"> +<title>PTR_TOP->PTR_PERSON</title> +<path fill="none" stroke="#555555" d="M1059.26,-657.6C1037.69,-642.45 1010.05,-623.04 989.76,-608.79"/> +<polygon fill="#555555" stroke="#555555" points="991.06,-607.14 984.95,-605.41 988.65,-610.58 991.06,-607.14"/> +</g> +<!-- PTR_S1 --> +<g id="node27" class="node"> +<title>PTR_S1</title> +<ellipse fill="#008000" stroke="black" cx="1051" cy="-588.3" rx="27" ry="18"/> +<text text-anchor="middle" x="1051" y="-584.2" font-family="DejaVu Sans" font-size="13.00" fill="white">*s1</text> +</g> +<!-- PTR_TOP->PTR_S1 --> +<g id="edge35" class="edge"> +<title>PTR_TOP->PTR_S1</title> +<path fill="none" stroke="#555555" d="M1080.4,-653.69C1074.4,-640.56 1067.32,-625.04 1061.6,-612.53"/> +<polygon fill="#555555" stroke="#555555" points="1063.62,-611.88 1059.22,-607.29 1059.8,-613.62 1063.62,-611.88"/> +</g> +<!-- PTR_MORE --> +<g id="node28" class="node"> +<title>PTR_MORE</title> +<ellipse fill="#008000" stroke="black" cx="1135" cy="-588.3" rx="40.6" ry="18"/> +<text text-anchor="middle" x="1135" y="-584.2" font-family="DejaVu Sans" font-size="13.00" fill="white">*s2, …</text> +</g> +<!-- PTR_TOP->PTR_MORE --> +<g id="edge36" class="edge"> +<title>PTR_TOP->PTR_MORE</title> +<path fill="none" stroke="#555555" d="M1105.6,-653.69C1111.55,-640.65 1118.59,-625.25 1124.28,-612.78"/> +<polygon fill="#555555" stroke="#555555" points="1126.08,-613.9 1126.66,-607.57 1122.26,-612.15 1126.08,-613.9"/> +</g> +<!-- PTR_TOP->STRUCT_TOP --> +<!-- PTR_BOT --> +<g id="node23" class="node"> +<title>PTR_BOT</title> +<ellipse fill="#008000" stroke="black" cx="1158" cy="-111.99" rx="66.47" ry="28.99"/> +<text text-anchor="middle" x="1158" y="-116.14" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥:ptr</text> +<text text-anchor="middle" x="1158" y="-99.64" font-family="DejaVu Sans" font-size="13.00" fill="white">[*⊥:struct?]</text> +</g> +<!-- PTR_BOT->BOT --> +<g id="edge87" class="edge"> +<title>PTR_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M1158,-82.64C1158,-70.25 1158,-55.86 1158,-43.89"/> +<polygon fill="#555555" stroke="#555555" points="1160.1,-43.94 1158,-37.94 1155.9,-43.94 1160.1,-43.94"/> +</g> +<!-- PTR_PERSON_NIL --> +<g id="node29" class="node"> +<title>PTR_PERSON_NIL</title> +<ellipse fill="#008000" stroke="black" cx="1111" cy="-482.64" rx="50.33" ry="18"/> +<text text-anchor="middle" x="1111" y="-478.54" font-family="DejaVu Sans" font-size="13.00" fill="white">*Person?</text> +</g> +<!-- PTR_NULL->PTR_PERSON_NIL --> +<g id="edge43" class="edge"> +<title>PTR_NULL->PTR_PERSON_NIL</title> +<path fill="none" stroke="#555555" d="M1203.98,-572.89C1185.68,-555.32 1154.58,-525.47 1133.44,-505.18"/> +<polygon fill="#555555" stroke="#555555" points="1134.9,-503.67 1129.12,-501.03 1131.99,-506.7 1134.9,-503.67"/> +</g> +<!-- PTR_S1_NIL --> +<g id="node30" class="node"> +<title>PTR_S1_NIL</title> +<ellipse fill="#008000" stroke="black" cx="1208" cy="-482.64" rx="30.37" ry="18"/> +<text text-anchor="middle" x="1208" y="-478.54" font-family="DejaVu Sans" font-size="13.00" fill="white">*s1?</text> +</g> +<!-- PTR_NULL->PTR_S1_NIL --> +<g id="edge44" class="edge"> +<title>PTR_NULL->PTR_S1_NIL</title> +<path fill="none" stroke="#555555" d="M1217.18,-570.18C1215.39,-553.3 1212.64,-527.33 1210.61,-508.24"/> +<polygon fill="#555555" stroke="#555555" points="1212.7,-508.03 1209.98,-502.29 1208.52,-508.48 1212.7,-508.03"/> +</g> +<!-- PTR_MORE_NIL --> +<g id="node31" class="node"> +<title>PTR_MORE_NIL</title> +<ellipse fill="#008000" stroke="black" cx="1300" cy="-482.64" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1300" y="-478.54" font-family="DejaVu Sans" font-size="13.00" fill="white">*s2?, …</text> +</g> +<!-- PTR_NULL->PTR_MORE_NIL --> +<g id="edge45" class="edge"> +<title>PTR_NULL->PTR_MORE_NIL</title> +<path fill="none" stroke="#555555" d="M1230.95,-572C1244.59,-554.55 1267.02,-525.85 1282.6,-505.91"/> +<polygon fill="#555555" stroke="#555555" points="1284.22,-507.24 1286.26,-501.22 1280.92,-504.65 1284.22,-507.24"/> +</g> +<!-- PTR_ANY --> +<g id="node25" class="node"> +<title>PTR_ANY</title> +<ellipse fill="#008000" stroke="black" cx="962" cy="-482.64" rx="82.38" ry="28.99"/> +<text text-anchor="middle" x="962" y="-486.79" font-family="DejaVu Sans" font-size="13.00" fill="white">*⊥:struct</text> +<text text-anchor="middle" x="962" y="-470.29" font-family="DejaVu Sans" font-size="13.00" fill="white">[ptr any struct]</text> +</g> +<!-- PTR_ANY->PTR_BOT --> +<g id="edge46" class="edge"> +<title>PTR_ANY->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M976.89,-453.63C1012.36,-386.92 1101.72,-218.85 1140.07,-146.72"/> +<polygon fill="#555555" stroke="#555555" points="1141.72,-148.08 1142.69,-141.79 1138.02,-146.11 1141.72,-148.08"/> +</g> +<!-- PTR_ANY->PTR_PERSON_NIL --> +<!-- PTR_PERSON->PTR_ANY --> +<g id="edge37" class="edge"> +<title>PTR_PERSON->PTR_ANY</title> +<path fill="none" stroke="#555555" d="M962,-570.18C962,-556.3 962,-536.26 962,-518.96"/> +<polygon fill="#555555" stroke="#555555" points="964.1,-519.25 962,-513.25 959.9,-519.25 964.1,-519.25"/> +</g> +<!-- PTR_PERSON->PTR_S1 --> +<!-- PTR_PERSON->PTR_PERSON_NIL --> +<g id="edge40" class="edge"> +<title>PTR_PERSON->PTR_PERSON_NIL</title> +<path fill="none" stroke="#555555" d="M983.67,-572.23C1009.89,-553.98 1054.1,-523.22 1082.92,-503.18"/> +<polygon fill="#555555" stroke="#555555" points="1083.85,-505.09 1087.58,-499.94 1081.45,-501.64 1083.85,-505.09"/> +</g> +<!-- PTR_S1->PTR_ANY --> +<g id="edge38" class="edge"> +<title>PTR_S1->PTR_ANY</title> +<path fill="none" stroke="#555555" d="M1038.25,-572.45C1025.79,-557.94 1006.41,-535.36 990.3,-516.6"/> +<polygon fill="#555555" stroke="#555555" points="991.91,-515.25 986.4,-512.07 988.72,-517.99 991.91,-515.25"/> +</g> +<!-- PTR_S1->PTR_MORE --> +<!-- PTR_S1->PTR_S1_NIL --> +<g id="edge41" class="edge"> +<title>PTR_S1->PTR_S1_NIL</title> +<path fill="none" stroke="#555555" d="M1072.08,-576.82C1101.29,-562.14 1152.34,-535.85 1169,-523.3 1176.35,-517.76 1183.64,-510.85 1189.88,-504.36"/> +<polygon fill="#555555" stroke="#555555" points="1191.26,-505.96 1193.83,-500.14 1188.2,-503.09 1191.26,-505.96"/> +</g> +<!-- PTR_MORE->PTR_NULL --> +<!-- PTR_MORE->PTR_ANY --> +<g id="edge39" class="edge"> +<title>PTR_MORE->PTR_ANY</title> +<path fill="none" stroke="#555555" d="M1111.67,-573.32C1085.45,-557.61 1042.2,-531.69 1008.92,-511.75"/> +<polygon fill="#555555" stroke="#555555" points="1010.35,-510.16 1004.12,-508.88 1008.19,-513.77 1010.35,-510.16"/> +</g> +<!-- PTR_MORE->PTR_MORE_NIL --> +<g id="edge42" class="edge"> +<title>PTR_MORE->PTR_MORE_NIL</title> +<path fill="none" stroke="#555555" d="M1160.16,-573.83C1182.97,-561.38 1217.31,-542.02 1246,-523.3 1255.42,-517.15 1265.42,-509.99 1274.23,-503.46"/> +<polygon fill="#555555" stroke="#555555" points="1275.36,-505.24 1278.9,-499.97 1272.84,-501.88 1275.36,-505.24"/> +</g> +<!-- PTR_PERSON_NIL->PTR_BOT --> +<g id="edge47" class="edge"> +<title>PTR_PERSON_NIL->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1113.2,-464.36C1120.45,-407.54 1143.62,-225.79 1153.48,-148.41"/> +<polygon fill="#555555" stroke="#555555" points="1155.53,-148.97 1154.21,-142.76 1151.36,-148.44 1155.53,-148.97"/> +</g> +<!-- PTR_PERSON_NIL->PTR_S1_NIL --> +<!-- PTR_S1_NIL->PTR_BOT --> +<g id="edge48" class="edge"> +<title>PTR_S1_NIL->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1205.66,-464.36C1197.95,-407.54 1173.3,-225.79 1162.8,-148.41"/> +<polygon fill="#555555" stroke="#555555" points="1164.92,-148.42 1162.04,-142.75 1160.76,-148.98 1164.92,-148.42"/> +</g> +<!-- PTR_S1_NIL->PTR_MORE_NIL --> +<!-- PTR_MORE_NIL->PTR_BOT --> +<g id="edge49" class="edge"> +<title>PTR_MORE_NIL->PTR_BOT</title> +<path fill="none" stroke="#555555" d="M1293.34,-464.36C1271.39,-407.36 1200.99,-224.61 1171.35,-147.66"/> +<polygon fill="#555555" stroke="#555555" points="1173.45,-147.25 1169.33,-142.4 1169.53,-148.76 1173.45,-147.25"/> +</g> +<!-- STRUCT_PERSON --> +<g id="node34" class="node"> +<title>STRUCT_PERSON</title> +<polygon fill="#90ee90" stroke="black" points="1436.5,-228.98 1369.5,-228.98 1369.5,-187.98 1436.5,-187.98 1436.5,-228.98"/> +<text text-anchor="middle" x="1403" y="-212.63" font-family="DejaVu Sans" font-size="13.00">Person</text> +<text text-anchor="middle" x="1403" y="-196.13" font-family="DejaVu Sans" font-size="13.00">age: int</text> +</g> +<!-- STRUCT_TOP->STRUCT_PERSON --> +<g id="edge53" class="edge"> +<title>STRUCT_TOP->STRUCT_PERSON</title> +<path fill="none" stroke="#555555" d="M1468.98,-653.31C1455.09,-615.46 1433,-545.54 1433,-483.64 1433,-483.64 1433,-483.64 1433,-375.98 1433,-326.01 1419.75,-268.92 1410.86,-236.25"/> +<polygon fill="#555555" stroke="#555555" points="1412.96,-235.95 1409.33,-230.72 1408.91,-237.07 1412.96,-235.95"/> +</g> +<!-- STRUCT_S1 --> +<g id="node35" class="node"> +<title>STRUCT_S1</title> +<polygon fill="#90ee90" stroke="black" points="1507,-228.98 1453,-228.98 1453,-187.98 1507,-187.98 1507,-228.98"/> +<text text-anchor="middle" x="1480" y="-212.63" font-family="DejaVu Sans" font-size="13.00">s1</text> +<text text-anchor="middle" x="1480" y="-196.13" font-family="DejaVu Sans" font-size="13.00">x: int</text> +</g> +<!-- STRUCT_TOP->STRUCT_S1 --> +<g id="edge54" class="edge"> +<title>STRUCT_TOP->STRUCT_S1</title> +<path fill="none" stroke="#555555" d="M1480,-652.82C1480,-614.41 1480,-543.86 1480,-483.64 1480,-483.64 1480,-483.64 1480,-375.98 1480,-327.01 1480,-269.94 1480,-236.93"/> +<polygon fill="#555555" stroke="#555555" points="1482.1,-236.99 1480,-230.99 1477.9,-236.99 1482.1,-236.99"/> +</g> +<!-- STRUCT_S2 --> +<g id="node36" class="node"> +<title>STRUCT_S2</title> +<polygon fill="#90ee90" stroke="black" points="1619.12,-228.98 1522.88,-228.98 1522.88,-187.98 1619.12,-187.98 1619.12,-228.98"/> +<text text-anchor="middle" x="1571" y="-212.63" font-family="DejaVu Sans" font-size="13.00">s2</text> +<text text-anchor="middle" x="1571" y="-196.13" font-family="DejaVu Sans" font-size="13.00">x: int, y: *s1</text> +</g> +<!-- STRUCT_TOP->STRUCT_S2 --> +<g id="edge55" class="edge"> +<title>STRUCT_TOP->STRUCT_S2</title> +<path fill="none" stroke="#555555" d="M1492.66,-653.47C1508.62,-615.79 1534,-546.07 1534,-483.64 1534,-483.64 1534,-483.64 1534,-375.98 1534,-325.74 1550.25,-268.96 1561.21,-236.38"/> +<polygon fill="#555555" stroke="#555555" points="1563.15,-237.2 1563.11,-230.84 1559.18,-235.84 1563.15,-237.2"/> +</g> +<!-- STRUCT_MORE --> +<g id="node37" class="node"> +<title>STRUCT_MORE</title> +<polygon fill="#90ee90" stroke="black" points="1689,-226.48 1635,-226.48 1635,-190.48 1689,-190.48 1689,-226.48"/> +<text text-anchor="middle" x="1662" y="-204.38" font-family="DejaVu Sans" font-size="13.00">…</text> +</g> +<!-- STRUCT_TOP->STRUCT_MORE --> +<g id="edge56" class="edge"> +<title>STRUCT_TOP->STRUCT_MORE</title> +<path fill="none" stroke="#555555" d="M1509.78,-656.19C1547.31,-621.55 1607,-555.22 1607,-483.64 1607,-483.64 1607,-483.64 1607,-375.98 1607,-322.84 1632.58,-264.74 1648.85,-233.17"/> +<polygon fill="#555555" stroke="#555555" points="1650.54,-234.47 1651.46,-228.18 1646.82,-232.52 1650.54,-234.47"/> +</g> +<!-- STRUCT_TOP->MEM_TOP --> +<!-- STRUCT_BOT --> +<g id="node33" class="node"> +<title>STRUCT_BOT</title> +<ellipse fill="#90ee90" stroke="black" cx="1480" cy="-111.99" rx="82.91" ry="28.99"/> +<text text-anchor="middle" x="1480" y="-116.14" font-family="DejaVu Sans" font-size="13.00">⊥:struct</text> +<text text-anchor="middle" x="1480" y="-99.64" font-family="DejaVu Sans" font-size="13.00">[struct bottom]</text> +</g> +<!-- STRUCT_BOT->BOT --> +<g id="edge88" class="edge"> +<title>STRUCT_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M1417.46,-92.56C1398.09,-86.88 1376.68,-80.65 1357,-75 1298.06,-58.08 1229.14,-38.8 1189.83,-27.85"/> +<polygon fill="#555555" stroke="#555555" points="1190.64,-25.89 1184.3,-26.31 1189.52,-29.94 1190.64,-25.89"/> +</g> +<!-- STRUCT_PERSON->STRUCT_BOT --> +<g id="edge57" class="edge"> +<title>STRUCT_PERSON->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1418.95,-187.9C1428.91,-175.69 1441.97,-159.66 1453.46,-145.57"/> +<polygon fill="#555555" stroke="#555555" points="1454.82,-147.22 1456.98,-141.24 1451.56,-144.57 1454.82,-147.22"/> +</g> +<!-- STRUCT_PERSON->STRUCT_S1 --> +<!-- STRUCT_S1->STRUCT_BOT --> +<g id="edge58" class="edge"> +<title>STRUCT_S1->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1480,-187.9C1480,-176.5 1480,-161.78 1480,-148.41"/> +<polygon fill="#555555" stroke="#555555" points="1482.1,-148.66 1480,-142.66 1477.9,-148.66 1482.1,-148.66"/> +</g> +<!-- STRUCT_S1->STRUCT_S2 --> +<!-- STRUCT_S2->STRUCT_BOT --> +<g id="edge59" class="edge"> +<title>STRUCT_S2->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1552.14,-187.9C1540.18,-175.48 1524.43,-159.12 1510.69,-144.86"/> +<polygon fill="#555555" stroke="#555555" points="1512.46,-143.67 1506.78,-140.8 1509.43,-146.58 1512.46,-143.67"/> +</g> +<!-- STRUCT_S2->STRUCT_MORE --> +<!-- STRUCT_MORE->STRUCT_BOT --> +<g id="edge60" class="edge"> +<title>STRUCT_MORE->STRUCT_BOT</title> +<path fill="none" stroke="#555555" d="M1634.54,-192.06C1632,-190.67 1629.45,-189.29 1627,-187.98 1596.23,-171.57 1561.48,-153.81 1533.49,-139.69"/> +<polygon fill="#555555" stroke="#555555" points="1534.55,-137.87 1528.25,-137.05 1532.67,-141.62 1534.55,-137.87"/> +</g> +<!-- MEM_ALIAS2 --> +<g id="node40" class="node"> +<title>MEM_ALIAS2</title> +<ellipse fill="#00008b" stroke="black" cx="1758" cy="-293.98" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1758" y="-289.88" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#2</text> +</g> +<!-- MEM_TOP->MEM_ALIAS2 --> +<g id="edge63" class="edge"> +<title>MEM_TOP->MEM_ALIAS2</title> +<path fill="none" stroke="#555555" d="M1804.8,-663.94C1796.95,-602.04 1770.29,-391.88 1761.12,-319.62"/> +<polygon fill="#555555" stroke="#555555" points="1763.22,-319.47 1760.39,-313.79 1759.06,-320 1763.22,-319.47"/> +</g> +<!-- MEM_ALIAS3 --> +<g id="node41" class="node"> +<title>MEM_ALIAS3</title> +<ellipse fill="#00008b" stroke="black" cx="1864" cy="-293.98" rx="45.21" ry="18"/> +<text text-anchor="middle" x="1864" y="-289.88" font-family="DejaVu Sans" font-size="13.00" fill="white">MEM#3</text> +</g> +<!-- MEM_TOP->MEM_ALIAS3 --> +<g id="edge64" class="edge"> +<title>MEM_TOP->MEM_ALIAS3</title> +<path fill="none" stroke="#555555" d="M1809.56,-663.94C1818.69,-602.04 1849.7,-391.88 1860.36,-319.62"/> +<polygon fill="#555555" stroke="#555555" points="1862.43,-320.02 1861.23,-313.78 1858.27,-319.41 1862.43,-320.02"/> +</g> +<!-- MEM_MORE --> +<g id="node42" class="node"> +<title>MEM_MORE</title> +<ellipse fill="#00008b" stroke="black" cx="1952" cy="-293.98" rx="27" ry="18"/> +<text text-anchor="middle" x="1952" y="-289.88" font-family="DejaVu Sans" font-size="13.00" fill="white">…</text> +</g> +<!-- MEM_TOP->MEM_MORE --> +<g id="edge65" class="edge"> +<title>MEM_TOP->MEM_MORE</title> +<path fill="none" stroke="#555555" d="M1813.42,-664.19C1836.63,-602.36 1916.24,-390.25 1943.08,-318.74"/> +<polygon fill="#555555" stroke="#555555" points="1944.98,-319.66 1945.12,-313.3 1941.05,-318.18 1944.98,-319.66"/> +</g> +<!-- MEM_TOP->TUPLE_TOP --> +<!-- MEM_BOT --> +<g id="node39" class="node"> +<title>MEM_BOT</title> +<ellipse fill="#00008b" stroke="black" cx="1811" cy="-111.99" rx="44.7" ry="18"/> +<text text-anchor="middle" x="1811" y="-107.89" font-family="DejaVu Sans" font-size="13.00" fill="white">⊥:mem</text> +</g> +<!-- MEM_BOT->BOT --> +<g id="edge89" class="edge"> +<title>MEM_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M1779.72,-98.78C1757.97,-90.77 1728.12,-80.77 1701,-75 1511.81,-34.78 1279.16,-23.1 1192.59,-20.01"/> +<polygon fill="#555555" stroke="#555555" points="1192.74,-17.92 1186.67,-19.81 1192.59,-22.11 1192.74,-17.92"/> +</g> +<!-- MEM_ALIAS2->MEM_BOT --> +<g id="edge66" class="edge"> +<title>MEM_ALIAS2->MEM_BOT</title> +<path fill="none" stroke="#555555" d="M1763.08,-275.72C1772.58,-243.47 1793.04,-173.99 1803.9,-137.12"/> +<polygon fill="#555555" stroke="#555555" points="1805.83,-138 1805.51,-131.65 1801.8,-136.81 1805.83,-138"/> +</g> +<!-- MEM_ALIAS2->MEM_ALIAS3 --> +<!-- MEM_ALIAS3->MEM_BOT --> +<g id="edge67" class="edge"> +<title>MEM_ALIAS3->MEM_BOT</title> +<path fill="none" stroke="#555555" d="M1858.92,-275.72C1849.42,-243.47 1828.96,-173.99 1818.1,-137.12"/> +<polygon fill="#555555" stroke="#555555" points="1820.2,-136.81 1816.49,-131.65 1816.17,-138 1820.2,-136.81"/> +</g> +<!-- MEM_ALIAS3->MEM_MORE --> +<!-- MEM_MORE->MEM_BOT --> +<g id="edge68" class="edge"> +<title>MEM_MORE->MEM_BOT</title> +<path fill="none" stroke="#555555" d="M1939.98,-277.64C1915.01,-245.76 1857.44,-172.28 1828.41,-135.22"/> +<polygon fill="#555555" stroke="#555555" points="1830.29,-134.21 1824.94,-130.79 1826.99,-136.8 1830.29,-134.21"/> +</g> +<!-- TUPLE1 --> +<g id="node45" class="node"> +<title>TUPLE1</title> +<polygon fill="#ffc0cb" stroke="black" points="2058.88,-394.98 2003.12,-394.98 2003.12,-358.98 2058.88,-358.98 2058.88,-394.98"/> +<text text-anchor="middle" x="2031" y="-372.88" font-family="DejaVu Sans" font-size="13.00">(type)</text> +</g> +<!-- TUPLE_TOP->TUPLE1 --> +<g id="edge71" class="edge"> +<title>TUPLE_TOP->TUPLE1</title> +<path fill="none" stroke="#555555" d="M2047.04,-664.12C2044.18,-613.14 2035.74,-462.58 2032.39,-402.83"/> +<polygon fill="#555555" stroke="#555555" points="2034.49,-402.73 2032.06,-396.86 2030.3,-402.97 2034.49,-402.73"/> +</g> +<!-- TUPLE2 --> +<g id="node46" class="node"> +<title>TUPLE2</title> +<polygon fill="#ffc0cb" stroke="black" points="2169,-394.98 2075,-394.98 2075,-358.98 2169,-358.98 2169,-394.98"/> +<text text-anchor="middle" x="2122" y="-372.88" font-family="DejaVu Sans" font-size="13.00">(type, type)</text> +</g> +<!-- TUPLE_TOP->TUPLE2 --> +<g id="edge72" class="edge"> +<title>TUPLE_TOP->TUPLE2</title> +<path fill="none" stroke="#555555" d="M2052.19,-664.12C2064.65,-613.04 2101.51,-461.97 2116.03,-402.46"/> +<polygon fill="#555555" stroke="#555555" points="2118.02,-403.14 2117.4,-396.82 2113.94,-402.15 2118.02,-403.14"/> +</g> +<!-- TUPLEN --> +<g id="node47" class="node"> +<title>TUPLEN</title> +<polygon fill="#ffc0cb" stroke="black" points="2262.75,-394.98 2185.25,-394.98 2185.25,-358.98 2262.75,-358.98 2262.75,-394.98"/> +<text text-anchor="middle" x="2224" y="-372.88" font-family="DejaVu Sans" font-size="13.00">(type, …)</text> +</g> +<!-- TUPLE_TOP->TUPLEN --> +<g id="edge73" class="edge"> +<title>TUPLE_TOP->TUPLEN</title> +<path fill="none" stroke="#555555" d="M2057.71,-664.55C2087.2,-613.73 2175.78,-461.08 2210.15,-401.84"/> +<polygon fill="#555555" stroke="#555555" points="2211.93,-402.97 2213.12,-396.73 2208.29,-400.87 2211.93,-402.97"/> +</g> +<!-- TUPLE_BOT --> +<g id="node44" class="node"> +<title>TUPLE_BOT</title> +<ellipse fill="#ffc0cb" stroke="black" cx="2076" cy="-111.99" rx="44.7" ry="18"/> +<text text-anchor="middle" x="2076" y="-107.89" font-family="DejaVu Sans" font-size="13.00">⊥:tuple</text> +</g> +<!-- TUPLE_BOT->BOT --> +<g id="edge90" class="edge"> +<title>TUPLE_BOT->BOT</title> +<path fill="none" stroke="#555555" d="M2049.6,-97.11C2033.2,-89.17 2011.42,-79.86 1991,-75 1835.49,-37.96 1329.53,-23.17 1192.5,-19.79"/> +<polygon fill="#555555" stroke="#555555" points="1192.69,-17.7 1186.64,-19.65 1192.58,-21.9 1192.69,-17.7"/> +</g> +<!-- TUPLE1->TUPLE_BOT --> +<g id="edge74" class="edge"> +<title>TUPLE1->TUPLE_BOT</title> +<path fill="none" stroke="#555555" d="M2033.95,-358.73C2041.72,-313.31 2062.77,-190.32 2071.79,-137.57"/> +<polygon fill="#555555" stroke="#555555" points="2073.84,-138.07 2072.78,-131.8 2069.7,-137.36 2073.84,-138.07"/> +</g> +<!-- TUPLE1->TUPLE2 --> +<!-- TUPLE2->TUPLE_BOT --> +<g id="edge75" class="edge"> +<title>TUPLE2->TUPLE_BOT</title> +<path fill="none" stroke="#555555" d="M2118.98,-358.73C2111.04,-313.31 2089.53,-190.32 2080.3,-137.57"/> +<polygon fill="#555555" stroke="#555555" points="2082.39,-137.35 2079.29,-131.8 2078.26,-138.07 2082.39,-137.35"/> +</g> +<!-- TUPLE2->TUPLEN --> +<!-- TUPLEN->TUPLE_BOT --> +<g id="edge76" class="edge"> +<title>TUPLEN->TUPLE_BOT</title> +<path fill="none" stroke="#555555" d="M2214.29,-358.73C2188.51,-312.92 2118.33,-188.21 2089.08,-136.23"/> +<polygon fill="#555555" stroke="#555555" points="2091.07,-135.49 2086.3,-131.29 2087.41,-137.55 2091.07,-135.49"/> +</g> +</g> +</svg> diff --git a/chapter15/README.md b/chapter15/README.md index 8ab3378b..1485b04c 100644 --- a/chapter15/README.md +++ b/chapter15/README.md @@ -1,5 +1,8 @@ # Chapter 15: Arrays +[Previous: Chapter 14](../chapter14/README.md) | +[Next: Chapter 16](../chapter16/README.md) + # Table of Contents 1. [Parser changes](#parser) @@ -12,8 +15,8 @@ At long last we introduce arrays! These require more complex addressing math, -which in turn means we need to change how Loads and Stores do addressing - -with true field *offsets* instead of field *names*. This means we also +which in turn means we need to change how Loads and Stores do addressing - +with true field *offsets* instead of field *names*. This means we also will do a struct field *layout* in this chapter. Arrays are created with the standard `new int[len]` syntax, and can be any base @@ -31,7 +34,8 @@ will panic the Evaluator. - `new int[-1]; // Negative length` - `new int[1<<63]; // Too large` - `new int[3.14]; // Not an integer` - + + You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter15) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter14...linear-chapter15) it to the previous chapter. @@ -47,7 +51,7 @@ Arrays are always created with zero/null bodies, so implicitly always allow We make a new array with much the same syntax as making a new object: `new int[99]`. The length is required and is any integer expression, so -e.g. `int[arg]` is an integer array of length `arg`. Multi-dimensional arrays +e.g. `new int[arg]` is an integer array of length `arg`. Multi-dimensional arrays only make the outer dimension; the elements themselves are all null and typed as the next lower dimension array. @@ -57,10 +61,11 @@ post-fix `#` operator; e.g. `ary#`. Example to sum an array: ```java int[] ary = new int[arg]; +int sum = 0; int i = 0; -while( i < ary# ) { - sum = sum + ary[i]; - i = i + 1; +while( i < ary# ) { + sum = sum + ary[i]; + i = i + 1; } ``` @@ -127,14 +132,14 @@ a read before allocation and a later write to an existing object. ## New Address Math -Since arrays need adressing math to index into them, Loads and Stores need a +Since arrays need addressing math to index into them, Loads and Stores need a way to compute an offset. Previously Loads and Stores only worked on structs, -and included the field name within them - thus the impicit addressing was field +and included the field name within them - thus the implicit addressing was field name (e.g. a string lookup!). New in this chapter we create a struct *layout* and compute field offsets to all structs. Loads and Stores now take an `off` instead of a field name, and the field -name is included for debugging only. +name is included for debugging only. ```java public MemOpNode(String name, int alias, Type glb, Node mem, Node ptr, Node off) { @@ -178,8 +183,8 @@ mod 8. This means the actual field offset and the field declaration order are ```java struct s { - int8 b; // log_size=0 - uint16 char; // log_size=1 + i8 b; // log_size=0 + u16 char; // log_size=1 Person p; // log_size=2 flt pi; // log_size=3 } @@ -187,9 +192,9 @@ struct s { struct s { flt pi; // offset= 0, log_size=3 Person p; // offset= 8, log_size=2 - uint16 char; // offset=12, log_size=1 - int8 b; // offset=13, log_size=0 - void pad; // offset=14, size = 2 + u16 char; // offset=12, log_size=1 + i8 b; // offset=14, log_size=0 + void pad; // offset=15, size = 1 } // size =16 ``` @@ -200,7 +205,7 @@ this could be changed at a later date to support a larger range of pointers. integer ranges. Other ranges are possible in Simple via `compute` calls, but these will never show up as base field types: - `struct S { int16 x; }` + `struct S { i16 x; }` Here `x` will have offset 0 and size 2 bytes, and `S` will be padded to size 8. @@ -221,17 +226,17 @@ This means the IR for: `x[i]` becomes `16/*base*/ + (i << 3/*scale*/)` becomes `Load(mem,x,Add(Shl(i,3),16))` - - + + `x[i+1]` becomes `16/*base*/ + ((i+1) << 3/*scale*/)` becomes `Load(mem,x,Add(Shl(i,3),24))` Notice the `idx+1` folds the `+1` into the base math. - + ## Discussion -Included in the test cases in a simple rolling sum, and a Sieve of Eratosthenes. +Included in the test cases is a simple rolling sum, and a Sieve of Eratosthenes. ```java int i=0; @@ -241,7 +246,7 @@ while( i < ary# ) { } ``` -Here we really see the lack of a `i++` operator and a `for` loop. You can +Here we really see the lack of an `i++` operator and a `for` loop. You can imagine another syntax: ```java @@ -249,6 +254,6 @@ for( int i=0; i < ary#; i++ ) ary[i] = i; ``` -that would be entirely syntatic-sugar over the existing parser, but would +that would be entirely syntactic-sugar over the existing parser, but would really help make array looping syntax clearer. There are lots of options here, which should really be the focus of another chapter! diff --git a/chapter16/README.md b/chapter16/README.md index 1c598568..663f175a 100644 --- a/chapter16/README.md +++ b/chapter16/README.md @@ -1,5 +1,8 @@ # Chapter 16: Constructors and Final fields +[Previous: Chapter 15](../chapter15/README.md) | +[Next: Chapter 17](../chapter17/README.md) + # Table of Contents 1. [Constructors](#constructors) @@ -24,12 +27,12 @@ Fields are initialized in three ways: syntax is required. ``` int x; // x is initialized to 0 -struct Ref { Ref ptr?; }; // Instances of Ref will have ptr initialized to null +struct Ref { Ref? ptr; }; // Instances of Ref will have ptr initialized to null return new Ref.ptr; // Returns a null ``` 2. The type declaration can specify an initial value. Later allocations will - start with this value. + start with this value. ``` int x = 5; // x is initialized to 5 struct Point { int x=1; int y=1; }; // Point x and y will start as 1, not 0 @@ -37,7 +40,7 @@ return new Point.x; // Returns a 1 ``` 3. The allocation can specify an initial value. - + ``` struct Point { int x=1; int y=1; }; // Point x and y will start as 1, not 0 return new Point { x=3; }.x; // Returns a 3 @@ -63,12 +66,12 @@ declaration or the allocation. Any amount of code is legal, including ``` struct Square { flt side = arg; - flt diag = arg*arg/2; - // Newtons approximation to the square root, computed in a constructor. + flt diag = arg*arg/2; + // Newton's approximation to the square root, computed in a constructor. // The actual allocation will copy in this result as the initial // value for 'diag'. while( 1 ) { - // The next-guess variable "next" is not a field in Square, + // The next-guess variable "next" is not a field in Square, // because it does not appear at the top level flt next = (side/diag + diag)/2; if( next == diag ) break; diff --git a/chapter17/README.md b/chapter17/README.md index a3a2d992..ea1fef28 100644 --- a/chapter17/README.md +++ b/chapter17/README.md @@ -1,15 +1,19 @@ # Chapter 17: Syntax Sugar +[Previous: Chapter 16](../chapter16/README.md) | +[Next: Chapter 18](../chapter18/README.md) + + +## Table of Contents 1. [Pre/Post-increment](#prepost-increment) 2. [Operator assignment](#operator-assignment) 3. [var/val](#var--val) - - [Example(1)](#example1) - - [Example(2)](#example2) 4. [Mutability](#mutability) 5. [Reference immutability](#reference-variables-with-an-initializer-are-deeply-immutable) 6. [Trinary](#trinary) 7. [For Loops](#for-loops) +8. [Memory effects](#memory-effects) ## Pre/Post-increment @@ -38,7 +42,7 @@ Assignments associate right-to-left, as in `x |= y <<= 2`. ## var & val `var` can be used in the `type` position to indicate a "variable" (mutable -value), whose type will be inferred from the required initalizing expression. +value), whose type will be inferred from the required initializing expression. `val` is the same as `var`, except it is a "value" (not mutable). @@ -51,7 +55,7 @@ nullable, so e.g. infers as -`S s? = new S;` +`S? s = new S;` ## Mutability @@ -59,7 +63,7 @@ infers as Typed primitive fields are always mutable. Typed reference fields without an initializer must be mutable to get a value. Initialized reference variables are immutable by default and can be made mutable with a leading `!`. Contrast -this with what [chapter16](https://github.com/SeaOfNodes/Simple/tree/chapter16) +this with what [Chapter 16](../chapter16/README.md) did with `!`. `var` and `val` keep their current sense and can be used to make any field mutable or immutable. Fields are always mutable during construction, but will become immutable at the end of either constructor. diff --git a/chapter18/README.md b/chapter18/README.md index 42f76227..5691059f 100644 --- a/chapter18/README.md +++ b/chapter18/README.md @@ -1,7 +1,11 @@ # Chapter 18: Functions +[Previous: Chapter 17](../chapter17/README.md) | +[Next: Chapter 19](../chapter19/README.md) + # Table of Contents + 1. [FunctionTypes](#function-and-rpc-types) 2. [Return Program Counters](#return-program-counters) 3. [Functions](#functions) @@ -24,7 +28,7 @@ Highlights of the changes: - The top-level is now a call to function `main`, and this changed most tests. - A top-level compile driver, which enforces optimization steps. - A local scheduler. -- A new evaluator which relies on at code motion, both global and local. +- A new evaluator which relies on code motion, both global and local. - A graphic animated viewer for peepholes. Functions are *not* closures in this chapter; that brings about far more @@ -43,7 +47,7 @@ constant. This generally includes e.g. recursive function pointers. A leading `{` character denotes the start of a function or function type, then a list of argument types, and an arrow `->` and the return type. -Functions variables are normal variables and assigned the same way: +Function variables are normal variables and assigned the same way: `functiontype fcn = function-typed-expr;` @@ -84,7 +88,7 @@ scope, so for now these are only used in the evaluator. ## Functions -Functions themselves using the same syntax with as function types, but filled in: +Functions themselves use the same syntax as function types, but filled in: ``` { flt x, flt y -> // Signature @@ -102,13 +106,13 @@ Used in a declaration statement: With `var`: ``` -var dist = { flt x, flt y -> sqrt(x*x*,y*y); } +var dist = { flt x, flt y -> sqrt(x*x+y*y); } ``` Functions are called in the usual way: `dist( 1.2, 2.3 ) // yields 2.59422435` -Functions can have zero arguments, in which case the `->` argument seperator is +Functions can have zero arguments, in which case the `->` argument separator is optional. This allows any section of code to be "thunked" by wrapping it in `{}`. @@ -121,7 +125,7 @@ Called: Functions are always anonymous. When finally assigned to a variable, they will pick up the variable name for debugging and display purposes, but this has no -semantics meaning. Here is a function variable referring to more than one +semantic meaning. Here is a function variable referring to more than one anonymous function; the resulting function either doubles or squares: `val fcn = arg ? { int x -> x+x; } : { int x -> x*x; };` @@ -130,9 +134,9 @@ anonymous function; the resulting function either doubles or squares: Functions can be recursive: ``` -val fact = { int n -> - n <=1 ? n : n*fact(n-1); -}; +val fact = { int n -> + n <=1 ? n : n*fact(n-1); +}; return fact(4); // Returns 4! or 24 ``` @@ -179,7 +183,7 @@ After a `Call` is a `CallEndNode`, internally abbreviated as `cend`. The `CallEnd` will take the `Call` as an input, and also every *linked* function: functions the call-site *knows* it will call. This will be expanded later to be a conservative approximation to the *Call Graph*, with each `CallEnd` -*linked* to ever function it *may* call; if a function is not linked it can not +*linked* to every function it *may* call; if a function is not linked it can not be called from here. This requires a global analysis (fast, cheap, incremental, and global), not in this chapter. So for the moment we only link exact constant functions. @@ -204,8 +208,8 @@ programs. The phases (for now) are: reports on failed null checks. - *Schedule* - Global Code Motion scheduler. After this phase, all nodes belong in some basic block, with the normal suspect CFGNodes being basic blocks. -- *LocalSched* - a local scheduler. Its completely naive, except it enforces - some required rules: Phis appear at block heads, branchs at block exits. +- *LocalSched* - a local scheduler. It's completely naive, except it enforces + some required rules: Phis appear at block heads, branches at block exits. There's room in the algorithm for a much more sophisticated list scheduler. The `Eval2` evaluator requires this information. - *RegAlloc* - Not implemented (yet). @@ -214,7 +218,7 @@ Several globals moved from the Parser to CodeGen, and probably several others ought to move here. There is a very nice `toString()` here; hovering over the `code` variable in -the debug winow will pretty-print the IR "as if" globally scheduled, and the +the debug window will pretty-print the IR "as if" globally scheduled, and the code becomes very readable. @@ -229,12 +233,13 @@ recursive calls). ## Graph Visualizer -Run as `make view`, type your program in the text box, click -outside the box and then use the arrow keys to view IR generator both forwards -and backwards. +Run `make view`, type your program in the text box, and click **Compile** +(or press **Ctrl+Enter**). Use the Left/Right arrow keys to step through graph +construction and optimization. See the [shared viewer guide](../graph/README.md). -Nodes are color coded according to type, same as the lattice diagrams. Nodes -are shaped according to node function as well. At the bottom are `ScopeNode`s, +Nodes use colors and shapes for their graph roles: control, data, memory, Phis, +and scopes. This palette is distinct from the type-lattice diagrams. The viewer +also displays `ScopeNode`s, which only exist for the Parser but are actual Nodes and have `use->def` edges into the IR. diff --git a/chapter19/README.md b/chapter19/README.md index 63929b34..ef3ee118 100644 --- a/chapter19/README.md +++ b/chapter19/README.md @@ -1,5 +1,8 @@ # Chapter 19: Instruction Selection and Portable Compilation +[Previous: Chapter 18](../chapter18/README.md) | +[Next: Chapter 20](../chapter20/README.md) + You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter19) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter18...linear-chapter19) it to the previous chapter. @@ -7,11 +10,11 @@ You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linea The output of Instruction Selection - the mapping from idealized Simple Nodes to machine-specific ones - is difficult to test in bulk without an execution -strategy. We won't have an execution stratgy until all three of Instruction +strategy. We won't have an execution strategy until all three of Instruction Selection, Register Allocation and Encodings are done. Hence in and around the completion of Encoding we expect to find lots of bugs in Instruction Selection and Register Allocation. We certainly hand-inspect the output and fix obvious -problems, but still lots bugs linger until we can actually run the code. +problems, but still lots of bugs linger until we can actually run the code. This means that other chapters have updates and bug-fixes to the work being described here. @@ -84,9 +87,9 @@ memory, and argument inputs. `Machines` define registers as small dense integers. The Register Allocator will use these numbers when allocating. The mappings from small integers to -machine registers is up to the porter, but there's usally an obvious +machine registers is up to the porter, but there's usually an obvious one-to-one. For the X86, RAX will be register 0, RCX register 1 and so on up -to the 16 GPRs. The XMM registers at 16 and go up to 32. Register numbers +to the 16 GPRs. The XMM register numbers start at 16 and go through 31. Register numbers must be unique; this is how the register allocator tracks them. A `RegMask` Register Mask class holds onto bitsets of allowed registers. Most @@ -102,7 +105,7 @@ really "bind up" the set of allowed registers. ## An X86_64_V2 port, with SystemV or Win64 calling conventions In the `node/cpus/x86_64_v2` directory is a `x86_64_v2.java` port to an X86 64 -V2. This port supports 16 64-bit GPRs, 32 XMM registers and the X86 flags. +V2. This port supports 16 64-bit GPRs, 16 XMM registers and the X86 flags. There is a pattern matcher for matching X86 ops from idealized Simple Sea-of-Nodes. Except for the addressing modes pattern matcher matches nearly one-for-one X86 ops from ideal nodes. @@ -141,7 +144,7 @@ Sea-of-Nodes. Currently, we are targeting `RVA23U64`. ### Normal instruction selection -Works the same way as **X86_64_V2**, since riscv doesn't have *complex* addressing modes, greedy +Works the same way as **X86_64_V2**, since riscv doesn't have *complex* addressing modes, greedy pattern matching doesn't apply to most of the cases. Ops without any special behavior simply do the lookup. ### Restricted ISA @@ -158,14 +161,14 @@ eliminating the need for a separate comparison step. E.g ``` -beq x10, x11, some_label +beq x10, x11, some_label ``` `CBranchRISC` implements this behavior. ### No R-Flags -No R-flags exist in RiSC-V. To obtain similar functionality: +No R-flags exist in RISC-V. To obtain similar functionality: We can set the value of registers based on the result of the comparison this way explicitly. ``` xor a0, a0, a1 @@ -189,10 +192,10 @@ fadd.s fa0, fa5, fa4 (No load is needed prior to `flw`) ### ABI names(registers) -In `RISC-V`, general-purpose registers (`GPRs`) range from `x0` to `x31`, and floating-point registers range +In `RISC-V`, general-purpose registers (`GPRs`) range from `x0` to `x31`, and floating-point registers range from `f0` to `f31`. -To enhance readability and align with calling conventions, RISC-V defines ABI names for registers, providing more intuitive aliases +To enhance readability and align with calling conventions, RISC-V defines ABI names for registers, providing more intuitive aliases instead of raw register numbers. @@ -211,7 +214,7 @@ instead of raw register numbers. When passing in arguments to a function, the first 8 arguments from the caller are passed in registers `a0` to `a7`. ### Load floats -Currently, floating-point constants are first loaded into an `integer GPR` before being converted into a floating-point register. +Currently, floating-point constants are first loaded into an `integer GPR` before being converted into a floating-point register. This process is rewritten in the RA stage as: @@ -219,7 +222,7 @@ This process is rewritten in the RA stage as: lui a0, 262144 fmv.w.x fa0, a0 ```` -For non-constant values, we use a broader register mask that +For non-constant values, we use a broader register mask that supports both GPRs and FPRs. This implementation can be found in: `nodes/cpus/riscv/LoadRISC`. @@ -227,4 +230,3 @@ supports both GPRs and FPRs. This implementation can be found in: - diff --git a/chapter20/README.md b/chapter20/README.md index 271653c6..f3c566e5 100644 --- a/chapter20/README.md +++ b/chapter20/README.md @@ -1,6 +1,9 @@ # Chapter 20: Graph Coloring Register Allocation -## Some Reading Material +[Previous: Chapter 19](../chapter19/README.md) | +[Next: Chapter 21](../chapter21/README.md) + +## Some Reading Material This is a Briggs-Chaitin-Click allocator, and is very similar to the one used in HotSpot's C2 allocator for the past 25 years with great success. @@ -18,17 +21,17 @@ or Chaitin in combination. Basically there was a spate of register allocation improvements in this era that made it into many high-end mainstream compilers. I've included a very old unpublished paper on speeding up graph coloring -allocators: [Interference Graph Triming](docs/ifg_trim.pdf). +allocators: [Interference Graph Trimming](docs/ifg_trim.pdf). ## Meta-Issues / Code-Dev Issues of Instruction Selection, Register Allocation and Encodings The output of Register Allocation - an allocation of registers to ops - is difficult to test in bulk without an execution strategy. We won't have an -execution stratgy until all three of Instruction Selection, Register Allocation +execution strategy until all three of Instruction Selection, Register Allocation and Encodings are done. Hence in and around the completion of Encoding we expect to find lots of bugs in Instruction Selection and Register Allocation. -We certainly hand-inspect the output and fix obvious problems, but still lots +We certainly hand-inspect the output and fix obvious problems, but still lots of bugs linger until we can actually run the code. This means that other chapters have updates and bug-fixes to the work being @@ -43,7 +46,7 @@ You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linea ## The Basic Theory -The reading material includes several explainations of the basic concepts, but +The reading material includes several explanations of the basic concepts, but at the risk of being redundant I'll present a short version again here. I assume you (the reader) know *why* register allocation is required: machine @@ -53,7 +56,7 @@ they need to be allocated well. Graph Coloring is one such allocation method; machine registers are treated as colors; a *live range interference graph* is built, with each *live range* requiring its own register/color. Coloring the graph ensures every live range -gets a unique register, specificially when it overlaps or *interferes* with +gets a unique register, specifically when it overlaps or *interferes* with another live range. A successful coloring ends the allocation and after some bookkeeping the @@ -82,14 +85,14 @@ Coloring proceeds in rounds until we get a coloring: which also makes fewer larger live ranges. We'll be using the disjoint Union-Find algorithm to rapidly build up live ranges in one forward pass over the program. - -- Build the Inteference Graph: every live range which is alive at the same time + +- Build the Interference Graph: every live range which is alive at the same time as any other, now *interferes* or conflicts. This is built using a LIVE-ness pass, which is a backwards pass over the CFG, and can require more than one pass according to loop nesting depth. The data structure here is generally a 2-D bitset, triangulated to cut its size in half. As part of LIVE, we'll also have a set of reaching defs per-block. - + - Color the interference graph. Nodes (live ranges) in the graph which are strictly low degree (more available registers than neighbors) are guaranteed to get a color. These can be removed from the graph - since they will @@ -117,8 +120,8 @@ Coloring proceeds in rounds until we get a coloring: Registers are the thing that Register Allocation is all about! They are represented as a small dense integer, starting up from 0, and the numbering generally follows from the hardware encodings. So for an X86_64, RAX will be -register 0, RCX register 1 and so on up to the 16 GPRs. The XMM registers at -16 and go up to 32. Register numbers must be unique; this is how the register +register 0, RCX register 1 and so on up to the 16 GPRs. The XMM register numbers start at +16 and go through 31. Register numbers must be unique; this is how the register allocator tracks them. #### Why a RegMask class and not a simple `long`? @@ -137,7 +140,7 @@ bit value directly in Java, Simple will pick up a `RegMask` class object. #### Stack Slots -One of the Click extensions is this notion of treating "stack slots" are Just +One of the Click extensions is this notion of treating "stack slots" as Just Another Register. They get colored like other registers, which in turn leads to very efficient use of the stack; C2 is known for having very small stack frames. Another benefit is callee save registers will get split preferentially @@ -208,9 +211,9 @@ allocation the `LRG._mask` field holds the set of available registers, typically all the defaults, minus various conflicts. The `LRG._adj` holds a list of adjacent neighbors as part of the larger -Interference Graph, and is only used during the Coloring phase. +Interference Graph, and is only used during the Coloring phase. [See more about graphs here.](https://en.wikipedia.org/wiki/Graph_(abstract_data_type)) -This is a "adjacency list" form of a Graph description, and is built from the +This is an "adjacency list" form of a Graph description, and is built from the IFG's 2-D collection of bits (itself a 1-D list of `BitSet`s). Graph coloring register allocation is one of the few places where changing the layout of a data structure mid-algorithm pays out. @@ -239,7 +242,7 @@ them). ### Hard-Conflicts -A live range can have a *hard confict*: conflicting register requirements, +A live range can have a *hard conflict*: conflicting register requirements, leading to no valid register choices. The obvious case is an incoming parameter fixed in e.g. `rdx` but also required as an exit value in `rax`. You can't pick both registers at once, so a split is required. During the build @@ -247,14 +250,14 @@ live ranges phase, every register constraint from every def and use are AND'd together; the `RegMask` might lose all valid registers, or remain with just a handful of register choices. -Hard-conflicts are usually found while build live ranges, and will trigger a +Hard-conflicts are usually found while building live ranges, and will trigger a round of splitting before building the interference graph or coloring. They can also be found during interference graph building, generally caused by a 1-register kill. ### Avoiding interferences -Once of the Click extensions to the Briggs-Chaitin allocator is to take +One of the Click extensions to the Briggs-Chaitin allocator is to take advantage of register constraints to lower the interference graph degree (which otherwise becomes an O(n^2) edge collection). If a live range LR1 is reduced to a single register (such as a call argument requiring `rdx`) and would @@ -279,7 +282,7 @@ e.g. a simple `fib` program: y = x; x = tmp; }; - + ``` In SoN SSA form: @@ -328,7 +331,7 @@ arbitrarily (lowest numbered register), and then we go looking for a better color. Biased coloring inspects first a sample def (if there is only one, then the One Def is inspected), and then a sample use. Inspection looks to see if "the other side" of a split is already colored; if so, and that color is -available it is choosen. If there is a split, but it is not colored - we +available it is chosen. If there is a split, but it is not colored - we recursively repeat the process on that split's other side. This is also done for the other input of two-address ops and one of a Phi node inputs. @@ -346,7 +349,7 @@ guaranteed a color. There is a conflicting tension here: Picking a live range with a large "area" (i.e. covering much of the program), and low "cost" to spill (i.e. fewer defs and uses, and outside of loops) will give a large win. A register will become free over a large part of the program -and allow coloring to success elsewhere. The normal ABI callee-save registers +and allow coloring to succeed elsewhere. The normal ABI callee-save registers are ideal in this case, defined on entry and used only on exit they cover the entire program. Also, spilling means only a single split on entry and another at exit. Spilling such live ranges basically builds a classic function @@ -362,7 +365,7 @@ outside a fast-path exit. BIG_AND_SLOW: add rsp,#12 mov [rsp+0],rbx // begin spilling callee-save registers - mov [rsp+4],r12 // + mov [rsp+4],r12 // // lots of code needing callee-save registers ``` @@ -389,7 +392,7 @@ and deciding on a splitting strategy. ### Split Self Conflict Self-conflict live ranges are discovered during the "Build the Interference -Graph" stage. If this happens we don't attempt a coloring (its nonsensical +Graph" stage. If this happens we don't attempt a coloring (it's nonsensical with self conflicts), but go straight to splitting. During the IFG building we gathered a subset of the conflicting definitions for this live range. Now we visit all those definition points and insert spills: @@ -401,8 +404,8 @@ we visit all those definition points and insert spills: - Before any use that extends a live range. This set of splits is fairly aggressive... but test cases requiring a split in -each of the listed locations are including in Chapter 20's test cases. We -cannot even attempt a color while we have self conflicts, so its important to +each of the listed locations are included in Chapter 20's test cases. We +cannot even attempt a color while we have self conflicts, so it's important to break up these live ranges quickly. This tends to over-split and the allocator leans on Biased Coloring and the final copy cleanup to remove some of the extras. Conservative coalescing will be introduced in a later chapter. @@ -443,7 +446,7 @@ into successively deeper loop nests in progressive rounds of splitting, and in the final case will split once after each def and before each use, even in the innermost loop. -The heurstic starts by discovering the min and max loop depth for all defs and +The heuristic starts by discovering the min and max loop depth for all defs and uses. If these vary, we will split *around* the outermost loop, putting in splits at the loop border and keeping an inner untouched live range that has no constraints from outside. If this fails to color, on the next round of @@ -462,7 +465,7 @@ RA uses a series of helper functions, each is fairly self-contained. after a def. Includes the work to put the split in its proper ordering in a Basic Block and do all edge maintenance. - **makeSplit** - Make a split (either clone a clonable constant, or ask the - `Machine` for a port-specific `SplitNode`. + `Machine` for a port-specific `SplitNode`). - **ldepth** - Given a min&max loop depth (compacted in a `long`), expand the loop depth range for a given node `n`. Used to decide when a def or use is "inside" a loop, which in turn is used to split around loops. @@ -475,7 +478,7 @@ A quick pass over the splits and after checking registers, we pull out the useless splits (and track the rest for "scoring" our allocation). We'll also bypass some split-after-splits, which can remove some redundant copying. -The registers remain available in the `RegAlloc` object via `alloc.regnum( Node n )` +The registers remain available in the `RegAlloc` object via `alloc.regnum( Node n )` and will be used by a following instruction encoding pass. diff --git a/chapter21/README.md b/chapter21/README.md index a2222a8f..18256cc6 100644 --- a/chapter21/README.md +++ b/chapter21/README.md @@ -1,5 +1,8 @@ # Chapter 21: Instruction Encoding and ELF +[Previous: Chapter 20](../chapter20/README.md) | +[Next: Chapter 22](../chapter22/README.md) + This chapter turns the scheduled, register-allocated graph into executable instructions. Each machine node writes its bytes; the compiler places blocks, resolves local references, and exports an ELF object for the linker. We can now diff --git a/chapter22/README.md b/chapter22/README.md index 426db34f..dfcebc40 100644 --- a/chapter22/README.md +++ b/chapter22/README.md @@ -1,5 +1,8 @@ # Chapter 22: A Hello, World! +[Previous: Chapter 21](../chapter21/README.md) | +[Next: Chapter 23](../chapter23/README.md) + It's high time for strings and printing! In this chapter we look at what it takes to make a basic string - not really a full fledged String class, that will wait for another chapter. @@ -16,7 +19,7 @@ Let's break it down. - `sys`: is Just A Variable Name. Like other variables, it is looked up in the current scope... which looks completely empty. Every Simple program now starts - with the `sys` variable in-scope. `sys` itself a normal `struct` + with the `sys` variable in-scope. `sys` itself is a normal `struct` and is defined in `src/main/smp/sys.smp`. - `sys.io.p`: lookup the `io` field in `sys` struct, which yields the `sys.io` struct; then a lookup of `p` (short for "print") in the `sys.io` struct. @@ -44,7 +47,7 @@ Simple now supports nested types - this is a name-space only change, so no new semantics - just the ability to nest type definitions. ```java -struct Outer { +struct Outer { struct Inner { int in; flt pi = 3.14; @@ -55,14 +58,14 @@ struct Outer { Any final field set in the declaration (as opposed to the constructor) is automatically a "static" field - it is final for all instances, and does not -need to be stored in each instances. Instead one copy is kept in a global +need to be stored in each instance. Instead one copy is kept in a global space (not really a *class* object yet) and loaded from there. In this example: - Instances of the `Outer` struct have a single `int` field `out`. - Instances of the `Inner` struct have a single `int` field `in`. -- There exists a `Outer.Inner.pi` field in a global space with value `3.14`. +- There exists an `Outer.Inner.pi` field in a global space with value `3.14`. The `sys` struct is another example, with nested `libc` and `io` structs at least. All the fields in these structs are all final, hence static. @@ -78,7 +81,7 @@ call: `{ i32 fd, i64 buf, u32 len -> u32 } write = "C";` Any final variable assigned as "C" will be considered defined externally. The -syntax of this might change slightly to avoid ambiguity with assign the same +syntax of this might change slightly to avoid ambiguity with assigning the same "C" string. There is no linker support for getting the correct signature or namespace; the @@ -241,9 +244,6 @@ shuffling optimizer worklists should normalize to essentially the same graph, so repeating allocation on those graphs adds little coverage. Use seed variation when investigating optimizer normalization or worklist-order failures. -Two pre-existing failures found during the review remain in the -[backport queue](../docs/chapter-backports.md): String fails during loop -analysis/scheduling at other optimizer seeds, and returning a function pointer -fails during relocation after Opto incorrectly deletes the referenced function. -Their reproductions and validation history are retained -there as separate correctness work. +The [backport record](../docs/chapter-backports.md) documents the resolved +String fall-through and returned-function retention/relocation failures, +including their reproductions and validation history. diff --git a/chapter23/README.md b/chapter23/README.md index 502387eb..debbf6dc 100644 --- a/chapter23/README.md +++ b/chapter23/README.md @@ -1,5 +1,8 @@ # Chapter 23: Methods and Revisiting Types +[Previous: Chapter 22](../chapter22/README.md) | +[Next: Chapter 24](../chapter24/README.md) + In this chapter we add *methods*, functions defined in structs which take a hidden `self` argument and can access the struct fields. Here is an `indexOf` method in a String-like class: @@ -8,7 +11,7 @@ hidden `self` argument and can access the struct fields. Here is an // A String-like class, with methods struct String { u8[~] buf; // Buffer of read-only characters - + // Return the index of the first character 'c' or -1 val indexOf = { u8 c -> // Hidden 'self' argument for( int i=0; i<buf#; i++ ) // Direct access to `buf` field @@ -62,7 +65,7 @@ used for type-checking, so sharper types means we allow more valid programs. function definition inside of a struct which takes the struct as an argument, i.e. *methods* taking a *self* argument. -Lets look at our `String.indexOf` example above. Here we define a `String` +Let's look at our `String.indexOf` example above. Here we define a `String` with an `indexOf` method; a hidden argument string `self` is passed in and searched. What is the type of `struct String`? @@ -76,11 +79,11 @@ i.e., the type of `String` has a reference to itself, nested inside the type of ## Less Cyclic Types -This problem of cyclic types has been around for a long time, and there a +This problem of cyclic types has been around for a long time, and there are a number of tried and true methods for dealing with them. One easy one is to have a type *definition* and a separate type *reference*. The reference refers to the type by doing some kind of lookup; an easy one is via the type name and -the parsers' symbol table i.e., some kind of hash table lookup. +the parser's symbol table i.e., some kind of hash table lookup. In this model the cycle is effectively avoided; all "back edges" in the type cycle are really done by the reference edge (itself possibly a hash table @@ -90,24 +93,24 @@ So why not go down this route? Because all type references lead back to the same type definition - which means any specialization of type information is lost, because *all* type -references lead back to the same definition and you end up taking the MEET +references lead back to the same definition and you end up taking the MEET over *all* paths. -Here's example, a Linked List with a Java `Object` or a C `void*` payload: +Here's an example, a Linked List with a Java `Object` or a C `void*` payload: ```java struct List { List next; - Object payload; // equivalently for C: void* + Object payload; // equivalently for C: void* } // Then walk a collection of ints and build a List: List nums = null; -for( int x : ary_ints ) +for( int x : ary_ints ) nums = new List{next=nums; payload=x; } - + // Again for strings: List strs = null; -for( String x : ary_strs ) +for( String x : ary_strs ) strs = new List{next=strs; payload=x; } ``` @@ -130,8 +133,8 @@ language nor type-variables per-se, but it goes a long way towards them. In this Chapter Simple handles cyclic types directly. This means we have `Type` objects whose child types can point back to the original - and that -means -[*recursive descent*](https://en.wikipedia.org/wiki/Recursive_descent_parser) +means +[*recursive descent*](https://en.wikipedia.org/wiki/Recursive_descent_parser) no longer works on Types. Up till now we've used recursive descent when building up Types: child types @@ -151,9 +154,9 @@ from a unique type ID; "visited" just means your unique ID is a key in the table. Every Type thus picks up a unique ID from a global counter. Since we will be interning Types we only need as many unique IDs as we have unique Types (plus a few spare to build and intern cycles). From prior history I know this -number is typically maxes out in the low thousands so a small integer will do. +number typically maxes out in the low thousands so a small integer will do. -Another thing - we want to keep as much of the our existing infrastructure as +Another thing - we want to keep as much of our existing infrastructure as we can, so we are going to keep all our existing recursive descent visitations with some small modifications. @@ -169,14 +172,14 @@ cycling. Time for an example! -Lets go with a linked list, where we might have cycles of unrelated payloads -(but here only strings). Might you, linked-list is almost always the wrong -structure for any given job (being wildly inefficent compared to easy +Let's go with a linked list, where we might have cycles of unrelated payloads +(but here only strings). Mind you, a linked list is almost always the wrong +structure for any given job (being wildly inefficient compared to easy alternatives) but it is a great tutorial data structure. ```java -struct List { +struct List { List? !next; // Next pointer or null str !name; // Payload }; @@ -203,7 +206,7 @@ print(hello); // Pass along the read-only version ``` What is the type of `hello`? It is the read-only type of `List`... and `List` is -a cyclic type. Lets look at `Type.makeRO`: +a cyclic type. Let's look at `Type.makeRO`: ```java public final Type makeRO() { @@ -231,10 +234,10 @@ until we hit `TypeStruct`: ```java @Override boolean _isFinal() { - if( _open ) return false; // May have more more non-final fields + if( _open ) return false; // May have more non-final fields if( VISIT.containsKey(_uid) ) // Test: been here before? return true; // Cycles assume final - VISIT.put(_uid,this); // Set: dont do this again + VISIT.put(_uid,this); // Set: don't do this again for( Field fld : _fields ) if( !fld._isFinal() ) return false; @@ -256,7 +259,7 @@ fields asking the same question recursively. For our example, we open the recursion (set a sentinel in `VISIT`), call `makeRO` on `struct List`, which then calls `_isFinal` which then checks the `_open` flag (not open), checks the `VISIT` (not visited), sets the -UID in `VISIT`and starts walking the fields. Fields check: +UID in `VISIT` and starts walking the fields. Fields check: `@Override boolean _isFinal() { return _final && _t._isFinal(); }` @@ -267,7 +270,7 @@ The first field is `List*? !next`, which is not-final, so immediately returns ### Making a cyclic type for Read-Only / Final -To make the build-then-intern more obvious, lets put unique IDs on all our +To make the build-then-intern more obvious, let's put unique IDs on all our Types. Here is the Type of `List` with sample UIDs following each unique type. Fields are also just types so also get UIDs. @@ -287,7 +290,7 @@ into the next line: `return recurOpen()._makeRO().recurClose();`. Once again `recurOpen` starts/opens our recursive walk, and then we call -`_makeRO()` which is overridden in every child Type class. Lets look at +`_makeRO()` which is overridden in every child Type class. Let's look at `TypeStruct`s version: ```java @@ -319,7 +322,7 @@ of simplicity we choose to approximate our types to only a single instance of In this example on first visit of `List` we will miss in `VISIT`. The next call to `ts = recurPre(_name,_open)` does common shared pre-recursive work: we make a new `TypeStruct` and **set** it in the `VISIT` table. The new `TypeStruct` -is a blank version of `List` will all fields attached; we force these fields to +is a blank version of `List` with all fields attached; we force these fields to be final right away but they are missing their types: ``` @@ -339,7 +342,7 @@ This recursion comes right back to `TypeStruct._makeRO()`, and hits in the ``` struct List#12 { - List#12 *? #13 next#14, // Recursve next field makes a cycle + List#12 *? #13 next#14, // Recursive next field makes a cycle ____ name#15 } ``` @@ -350,8 +353,8 @@ exist, so we end up with: ``` struct List#12 { - List#12 *? #13 next#14, // Recursve next field makes a cycle - str#2 name#15 // Reuse the interned type strt#2 + List#12 *? #13 next#14, // Recursive next field makes a cycle + str#2 name#15 // Reuse the interned type str#2 } ``` @@ -389,7 +392,7 @@ pointing back to the same R/O `List#12`. ### Cyclic HashCode and Equals -Cyclic `hashCodes` and `equals` deserve more discussion. When compare two +Cyclic `hashCodes` and `equals` deserve more discussion. When comparing two cycles for equivalence we want to be equivalent regardless of where the comparison starts. i.e. cycle `A<->B` should be equal to cycle `B<->A`. This means they both need the same hashcode, and this means we cannot use @@ -402,13 +405,13 @@ hash as `A.hash * 7 + B.hash` we get `1 * 7 + 3 == 10`, and then later we start from B we get: `B.hash * 7 + A.hash` and which then becomes `3 * 7 + 1 == 22`... and their hashes differ so the hash table might miss the equivalence. Also, if we simply use recursive descent in the cycle we'll -recurse until stack overflow and crash. +recurse until stack overflow and crash. We fix this by having `TypeStruct.hash()` *not* recurse - thus its hash function is somewhat weak, depending only on the field names and aliases. *Cyclic-equals* is triggered by the `VISIT` table being not-empty, and uses -another unrelated *visit* table, the `CEQUALS` table, to seperate concerns from +another unrelated *visit* table, the `CEQUALS` table, to separate concerns from `VISIT`. The cycle-equals check proceeds like the normal `eq` with recursive descent on the parts, and some up-front hard-and-fast static checks - and the ubiquitous **test-and-set** pattern before the recursion. diff --git a/chapter24/README.md b/chapter24/README.md index 59a893d9..ddb3bc5a 100644 --- a/chapter24/README.md +++ b/chapter24/README.md @@ -1,5 +1,8 @@ # Chapter 24: Chaining Relationals and Sparse Conditional Constant Propagation +[Previous: Chapter 23](../chapter23/README.md) | +[Next: Chapter 25](../chapter25/README.md) + In this Chapter we allow *chaining* conditionals, e.g. `(60 <= score < 90)` where `score` in the middle does not have to be repeated. @@ -21,20 +24,20 @@ You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linea Chaining relational tests offer a cleaner, more readable way to write chained comparisons without repeating the same variable. -```java +```java if (min <= x && x < max) ``` becomes -```java +```java if (min <= x < max) ``` This syntax saves space and makes the condition more intuitive, similar to how range checks are written in mathematics. E.g. -```java +```java int score = 75; if (60 <= score < 90) { sys.io.p("Pass"); @@ -42,7 +45,7 @@ if (60 <= score < 90) { ``` This checks if score is between 60 (inclusive) and 90 (exclusive), without repeating `score`. -Expressions that mix opposite directions of comparison, like using both +Expressions that mix opposite directions of comparison, like using both `<=` and `>=`, are not allowed by Simple's direction rule. ```java @@ -62,7 +65,7 @@ Equality operators (`==` and `!=`) have their normal, lower precedence; they are not links in a relational chain. It is not allowed to mix directions in a single chain: -```java +```java if (a <= b >= c) // Invalid ``` @@ -80,7 +83,7 @@ OR return 1 > 1; ``` The equality operator is valid in this form, but since it has lower precedence than comparisons, -```java +```java a < b == c ``` is parsed as: @@ -88,11 +91,11 @@ is parsed as: (a < b) == c ``` This might not be the intended chained comparison. -A more explicit alternative is: -```java +A more explicit alternative is: +```java a < b && b == c ``` -Comparisons can be chained together in any length, and different comparison operators may be +Comparisons can be chained together in any length, and different comparison operators may be mixed freely as long as they point in the same direction. Each intermediate operand is evaluated once. Later operands are evaluated only if earlier comparisons succeed, so calls and updates in a chain short-circuit. @@ -103,7 +106,7 @@ return 0 < arg < arg+1 < 4; ``` ### Tricky edge cases -```java +```java return 0 != arg != 1; ``` @@ -127,8 +130,8 @@ return ((a == b) == c); [SCCP](https://en.wikipedia.org/wiki/Sparse_conditional_constant_propagation) is the top-down version of the same peephole/constant-folding work we have -been doing all along. The rules for the algorithm are well known from the -literature and commonly taught at the college level; +been doing all along. The rules for the algorithm are well known from the +literature and commonly taught at the college level; [example slides](https://www.cse.psu.edu/~gxt29/teaching/cse522s23/slides/08monotoneFramework.pdf). - We have a lattice already @@ -191,7 +194,7 @@ happen: -### Conditional +### Conditional Since our control flow is in the same graph as our data flow (that's the major point of Sea-of-Nodes!), we need not do anything special and our algorithm is @@ -241,7 +244,7 @@ while( rand ) { ``` Here since `head` starts not-null, it can never be null and the -`default_action` can never happen, and the loop can +`default_action` can never happen, and the loop can simplify: ```java @@ -251,7 +254,7 @@ while( rand ) { } ``` -### Interprocedural +### Interprocedural In **Simple**, we let our SCCP run interprocedurally, again by (nearly) doing nothing: `CallNodes` call `FunNodes`, `ReturnNodes` return to `CallEndNodes` and they diff --git a/chapter25/README.md b/chapter25/README.md index 7ba16659..3261637c 100644 --- a/chapter25/README.md +++ b/chapter25/README.md @@ -1,5 +1,8 @@ # Chapter 25: Modules, Separate Compilation, and SSA Construction +[Previous: Chapter 24](../chapter24/README.md) | +[Chapter index](../README.md#chapters) + This chapter compiles Simple source files into reusable object files, loads their types and ideal IR into later compilations, and links native programs against a separately built system library. It also contains a substantial diff --git a/docs/type-float.svg b/docs/type-float.svg new file mode 100644 index 00000000..8d83b0bc --- /dev/null +++ b/docs/type-float.svg @@ -0,0 +1,5 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="44" height="20" viewBox="0 0 44 20" role="img" aria-labelledby="title"> + <title id="title">Float</title> + <rect width="44" height="20" rx="2" fill="#00ffff"/> + <text x="22" y="14" text-anchor="middle" font-family="Arial, sans-serif" font-size="13" fill="#000000">Float</text> +</svg> diff --git a/graph/README.md b/graph/README.md index a459898f..915746e9 100644 --- a/graph/README.md +++ b/graph/README.md @@ -120,8 +120,34 @@ visibility, neighborhood highlighting and selection. Clear selection with Escape and uncheck **Peep neighborhood** for an unmarked diagram. The SVG includes its styles and arrow markers and needs no JavaScript or viewer assets; check it into the chapter's docs and embed it like the existing static figures. -Existing `.gv` sources and their generated SVGs remain another way to maintain -documentation figures. +The chapter IR figures also have detached `.json` snapshots. These preserve the +illustrated topology, including schematic pre-optimization states that the +parser does not retain. Node IDs in these illustrations are illustrative; +omitted type annotations are not inferred. Their SVGs use this viewer's actual +layout, node shapes, colors, projection boxes, Region/Phi rows, and group routing. +The old `.gv` files beside these snapshots retain the original figure topology; +when both exist, the JSON is the maintained source for the SVG. + +To regenerate a snapshot, install Python Playwright and its Chromium browser, +then run from the repository root: + +```sh +python graph/render_docs.py chapter01/docs/01-graph.json +``` + +Use `--browser msedge` or `--browser chrome` for an installed Chromium browser, +or `--browser firefox`. The command serves viewer assets on an ephemeral local +port and renders headlessly, without connecting to a compiler or a live viewer. +This optional documentation tool is not needed to build or test the chapters. +The chapter `docs/Makefile` rules select JSON before a same-named legacy DOT +file. They accept `PYTHON` and `DOC_BROWSER` overrides, for example +`make -C chapter01/docs PYTHON=python DOC_BROWSER=msedge` from the repository root. + +The compact memory-dependency schematics in 10a/10b retain `.gv` sources to +preserve their deliberate horizontal layouts. They use the viewer palette and +node shapes; definitions are left of uses horizontally and above uses vertically, +with arrows from use to definition. Type lattices use their own domain colors +and top-to-bottom lattice order, rather than IR edge conventions. The launcher prints the viewer URL before opening the browser. If the desktop only raises an existing browser window, paste that URL into a new tab. Use @@ -509,8 +535,8 @@ defs/uses for its neighborhoods and no worklist or dependency lists. It retains The compiler DOT dump flag, parser graph directive, Java DOT generators and old viewer/transport classes have been removed from all chapters. Use **Save SVG** -for new documentation figures. Existing `.gv` sources, their checked-in SVGs -and the documentation Make rules for regenerating those SVGs remain. +for new documentation figures. The documentation Make rules render maintained +JSON snapshots with the shared viewer and the remaining `.gv` figures with DOT. Chapter 1 has no peepholes and supplies one completed parse snapshot. Chapter 2 shows constant folding; chapters 3 and 4 add variables and algebraic rewrites. diff --git a/graph/docs.mk b/graph/docs.mk new file mode 100644 index 00000000..ad792ff5 --- /dev/null +++ b/graph/docs.mk @@ -0,0 +1,24 @@ +# Included from a chapter's docs/Makefile. +# A viewer snapshot takes precedence over a legacy DOT source of the same name. +GRAPH_DOCS := ../../graph +PYTHON ?= python3 +DOC_BROWSER ?= chromium +JSON := $(wildcard *.json) +VIEW_SVG := $(JSON:.json=.svg) +GV := $(filter-out $(JSON:.json=.gv),$(wildcard *.gv)) +SVG := $(VIEW_SVG) $(GV:.gv=.svg) +.DELETE_ON_ERROR: + +.PHONY: all +all: $(SVG) + +$(VIEW_SVG): %.svg: %.json $(GRAPH_DOCS)/render_docs.py $(wildcard $(GRAPH_DOCS)/web/*.js) $(wildcard $(GRAPH_DOCS)/web/*.css) + $(PYTHON) $(GRAPH_DOCS)/render_docs.py --browser $(DOC_BROWSER) $< + +$(GV:.gv=.svg): %.svg: %.gv + dot -Tsvg $< > $@ + @sed -i 's/\r$$//' $@ + +.PHONY: clean +clean: + @rm -f $(SVG) diff --git a/graph/render_docs.py b/graph/render_docs.py new file mode 100644 index 00000000..a0c5ec26 --- /dev/null +++ b/graph/render_docs.py @@ -0,0 +1,71 @@ +"""Render documentation snapshots with the same layout and SVG export as make view. + +Requires Python Playwright and an installed browser; not needed to build chapters. +Example: python graph/render_docs.py --browser msedge chapter01/docs/01-graph.json +""" +import argparse +from functools import partial +from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer +import json +from pathlib import Path +from threading import Thread +from playwright.sync_api import sync_playwright + + +class QuietHandler(SimpleHTTPRequestHandler): + def log_message(self, *args): + pass + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--browser', default='chromium', choices=['chromium', 'msedge', 'chrome', 'firefox']) + parser.add_argument('snapshots', nargs='+', type=Path) + args = parser.parse_args() + web = Path(__file__).resolve().parent / 'web' + server = ThreadingHTTPServer(('127.0.0.1', 0), partial(QuietHandler, directory=str(web))) + Thread(target=server.serve_forever, daemon=True).start() + try: + with sync_playwright() as pw: + engine = pw.firefox if args.browser == 'firefox' else pw.chromium + options = {'channel': args.browser} if args.browser in ('msedge', 'chrome') else {} + browser = engine.launch(headless=True, **options) + page = browser.new_page(reduced_motion='reduce') + # No connection to a compiler or to the user's live viewer session. + page.route_web_socket('**', lambda ws: ws.on_message(lambda message: None)) + page.goto(f'http://127.0.0.1:{server.server_port}/index.html') + page.wait_for_function('rendererReady') + page.evaluate('''() => { + layout = new GraphLayout(); + document.getElementById("assocs").checked = true; + document.getElementById("near").checked = false; + }''') + for source in args.snapshots: + snap = json.loads(source.read_text(encoding='utf-8')) + page.evaluate('''async snap => { + const evt = {kind: "PHASE", phase: "Documentation", near: [], temps: []}; + const scene = await layout.run(snap, evt); + renderer.show(snap, scene, evt); + renderer.select(0); + }''', snap) + # Capture the normal export's Blob without bulk browser downloads. + svg = page.evaluate('''async () => { + const create = URL.createObjectURL, click = HTMLAnchorElement.prototype.click; + let blob; + URL.createObjectURL = value => { blob = value; return create(value); }; + HTMLAnchorElement.prototype.click = () => {}; + try { renderer.save(1); } + finally { URL.createObjectURL = create; HTMLAnchorElement.prototype.click = click; } + return await blob.text(); + }''') + target = source.with_suffix('.svg') + target.write_text(svg + '\n', encoding='utf-8', newline='\n') + print(target) + browser.close() + finally: + server.shutdown() + server.server_close() + + +if __name__ == '__main__': + main() |
