From 22df891893d30e9906d0b14fc3ae5d8e67d500b2 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 3 Oct 2026 14:03:48 -0700 Subject: Chapter renumber, and split ch 17 Renumber chapters 10a, 10b, 11, 12, 13, 14 -> 10, 11, 13, 12, [11,14]. Split ch 17 into a 17a and 17b; shuffle around im/mutable syntax to be consistent, and present it more slowly. THe new immutable syntax is pushed through all later chapters --- chapter11/docs/10-grammar.md | 125 +++++++ chapter11/docs/11-grammar.md | 125 ------- chapter11/docs/example1.gv | 20 ++ chapter11/docs/example1.json | 31 ++ chapter11/docs/example1.svg | 155 ++++++++ chapter11/docs/example2a.gv | 17 + chapter11/docs/example2a.json | 20 ++ chapter11/docs/example2a.svg | 103 ++++++ chapter11/docs/example2b-final.json | 251 +++++++++++++ chapter11/docs/example2b-final.svg | 110 ++++++ chapter11/docs/example2b-merged.json | 339 ++++++++++++++++++ chapter11/docs/example2b-merged.svg | 130 +++++++ chapter11/docs/example2b-split-y.json | 486 +++++++++++++++++++++++++ chapter11/docs/example2b-split-y.svg | 157 +++++++++ chapter11/docs/example2b.gv | 19 + chapter11/docs/example2b.json | 30 ++ chapter11/docs/example2b.svg | 150 ++++++++ chapter11/docs/example2c.gv | 15 + chapter11/docs/example2c.json | 23 ++ chapter11/docs/example2c.svg | 121 +++++++ chapter11/docs/graph1.gv | 79 ----- chapter11/docs/graph1.json | 25 -- chapter11/docs/graph1.svg | 123 ------- chapter11/docs/graph2.gv | 84 ----- chapter11/docs/graph2.json | 25 -- chapter11/docs/graph2.svg | 123 ------- chapter11/docs/graph3-snip.jpg | Bin 19681 -> 0 bytes chapter11/docs/graph3-snip.json | 17 - chapter11/docs/graph3-snip.svg | 91 ----- chapter11/docs/graph3.gv | 85 ----- chapter11/docs/graph3.json | 26 -- chapter11/docs/graph3.svg | 128 ------- chapter11/docs/graph4.gv | 110 ------ chapter11/docs/graph4.json | 24 -- chapter11/docs/graph4.svg | 120 ------- chapter11/docs/graph5.gv | 117 ------ chapter11/docs/graph5.json | 24 -- chapter11/docs/graph5.svg | 120 ------- chapter11/docs/graph6.gv | 117 ------ chapter11/docs/graph6.json | 25 -- chapter11/docs/graph6.svg | 124 ------- chapter11/docs/graph7.gv | 23 -- chapter11/docs/graph7.json | 16 - chapter11/docs/graph7.svg | 78 ---- chapter11/docs/graph8.gv | 45 --- chapter11/docs/graph8.json | 21 -- chapter11/docs/graph8.svg | 98 ------ chapter11/docs/lattice.gv | 133 +++++++ chapter11/docs/lattice.svg | 644 ++++++++++++++++++++++++++++++++++ 49 files changed, 3079 insertions(+), 1993 deletions(-) create mode 100644 chapter11/docs/10-grammar.md delete mode 100644 chapter11/docs/11-grammar.md create mode 100644 chapter11/docs/example1.gv create mode 100644 chapter11/docs/example1.json create mode 100644 chapter11/docs/example1.svg create mode 100644 chapter11/docs/example2a.gv create mode 100644 chapter11/docs/example2a.json create mode 100644 chapter11/docs/example2a.svg create mode 100644 chapter11/docs/example2b-final.json create mode 100644 chapter11/docs/example2b-final.svg create mode 100644 chapter11/docs/example2b-merged.json create mode 100644 chapter11/docs/example2b-merged.svg create mode 100644 chapter11/docs/example2b-split-y.json create mode 100644 chapter11/docs/example2b-split-y.svg create mode 100644 chapter11/docs/example2b.gv create mode 100644 chapter11/docs/example2b.json create mode 100644 chapter11/docs/example2b.svg create mode 100644 chapter11/docs/example2c.gv create mode 100644 chapter11/docs/example2c.json create mode 100644 chapter11/docs/example2c.svg delete mode 100644 chapter11/docs/graph1.gv delete mode 100644 chapter11/docs/graph1.json delete mode 100644 chapter11/docs/graph1.svg delete mode 100644 chapter11/docs/graph2.gv delete mode 100644 chapter11/docs/graph2.json delete mode 100644 chapter11/docs/graph2.svg delete mode 100644 chapter11/docs/graph3-snip.jpg delete mode 100644 chapter11/docs/graph3-snip.json delete mode 100644 chapter11/docs/graph3-snip.svg delete mode 100644 chapter11/docs/graph3.gv delete mode 100644 chapter11/docs/graph3.json delete mode 100644 chapter11/docs/graph3.svg delete mode 100644 chapter11/docs/graph4.gv delete mode 100644 chapter11/docs/graph4.json delete mode 100644 chapter11/docs/graph4.svg delete mode 100644 chapter11/docs/graph5.gv delete mode 100644 chapter11/docs/graph5.json delete mode 100644 chapter11/docs/graph5.svg delete mode 100644 chapter11/docs/graph6.gv delete mode 100644 chapter11/docs/graph6.json delete mode 100644 chapter11/docs/graph6.svg delete mode 100644 chapter11/docs/graph7.gv delete mode 100644 chapter11/docs/graph7.json delete mode 100644 chapter11/docs/graph7.svg delete mode 100644 chapter11/docs/graph8.gv delete mode 100644 chapter11/docs/graph8.json delete mode 100644 chapter11/docs/graph8.svg create mode 100644 chapter11/docs/lattice.gv create mode 100644 chapter11/docs/lattice.svg (limited to 'chapter11/docs') diff --git a/chapter11/docs/10-grammar.md b/chapter11/docs/10-grammar.md new file mode 100644 index 00000000..5a3f3778 --- /dev/null +++ b/chapter11/docs/10-grammar.md @@ -0,0 +1,125 @@ +# Grammar for Chapter 11 + +```antlrv4 +grammar SimpleLanguage; + +program + : statement+ EOF + ; + +statement + : returnStatement + | structDeclaration + | declStatement + | blockStatment + | expressionStatement + | ifStatement + | whileStatement + | breakStatement + | continueStatment + ; + +field + : 'int' IDENTIFIER ';' + ; + +fields + : field+ + ; + +structDeclaration + : 'struct' IDENTIFIER '{' fields '}' + ; + +whileStatement + : 'while' '(' expression ')' statement + ; + +breakStatement + : 'break' ';' + ; + +continueStatement + : 'continue' ';' + ; + +ifStatement + : 'if' '(' expression ')' statement ('else' statement)? + ; + + +expressionStatement + : IDENTIFIER '=' expression ';' + | fieldExpression '=' expression ';' + ; + +blockStatement + : '{' statement+ '}' + ; + +structName + : IDENTIFIER + ; + +declStatement + : 'int' IDENTIFIER '=' expression ';' + | structName ('?')? IDENTIFIER '=' expression ';' + ; + +returnStatement + : 'return' expression ';' + ; + +expression + : comparisonExpression + ; + +comparisonExpression + : additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)* + ; + +additiveExpression + : multiplicativeExpression (('+' | '-') multiplicativeExpression)* + ; + +multiplicativeExpression + : unaryExpression (('*' | '/') unaryExpression)* + ; + +unaryExpression + : ('-') unaryExpression + | '!' unaryExpression + | primaryExpression + ; + +newExpression + : 'new' IDENTIFIER + ; + +fieldExpression + : primaryExpresson '.' IDENTIFIER + ; + +primaryExpression + : IDENTIFIER + | INTEGER_LITERAL + | 'true' + | 'false' + | 'null' + | newExpression + | '(' expression ')' + | fieldExpression + ; + +INTEGER_LITERAL + : [1-9][0-9]* + | [0] + ; + +IDENTIFIER + : NON_DIGIT (NON_DIGIT | DIGIT)* + ; + +NON_DIGIT: [a-zA-Z_]; +DEC_DIGIT: [0-9]; +``` diff --git a/chapter11/docs/11-grammar.md b/chapter11/docs/11-grammar.md deleted file mode 100644 index 5a3f3778..00000000 --- a/chapter11/docs/11-grammar.md +++ /dev/null @@ -1,125 +0,0 @@ -# Grammar for Chapter 11 - -```antlrv4 -grammar SimpleLanguage; - -program - : statement+ EOF - ; - -statement - : returnStatement - | structDeclaration - | declStatement - | blockStatment - | expressionStatement - | ifStatement - | whileStatement - | breakStatement - | continueStatment - ; - -field - : 'int' IDENTIFIER ';' - ; - -fields - : field+ - ; - -structDeclaration - : 'struct' IDENTIFIER '{' fields '}' - ; - -whileStatement - : 'while' '(' expression ')' statement - ; - -breakStatement - : 'break' ';' - ; - -continueStatement - : 'continue' ';' - ; - -ifStatement - : 'if' '(' expression ')' statement ('else' statement)? - ; - - -expressionStatement - : IDENTIFIER '=' expression ';' - | fieldExpression '=' expression ';' - ; - -blockStatement - : '{' statement+ '}' - ; - -structName - : IDENTIFIER - ; - -declStatement - : 'int' IDENTIFIER '=' expression ';' - | structName ('?')? IDENTIFIER '=' expression ';' - ; - -returnStatement - : 'return' expression ';' - ; - -expression - : comparisonExpression - ; - -comparisonExpression - : additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)* - ; - -additiveExpression - : multiplicativeExpression (('+' | '-') multiplicativeExpression)* - ; - -multiplicativeExpression - : unaryExpression (('*' | '/') unaryExpression)* - ; - -unaryExpression - : ('-') unaryExpression - | '!' unaryExpression - | primaryExpression - ; - -newExpression - : 'new' IDENTIFIER - ; - -fieldExpression - : primaryExpresson '.' IDENTIFIER - ; - -primaryExpression - : IDENTIFIER - | INTEGER_LITERAL - | 'true' - | 'false' - | 'null' - | newExpression - | '(' expression ')' - | fieldExpression - ; - -INTEGER_LITERAL - : [1-9][0-9]* - | [0] - ; - -IDENTIFIER - : NON_DIGIT (NON_DIGIT | DIGIT)* - ; - -NON_DIGIT: [a-zA-Z_]; -DEC_DIGIT: [0-9]; -``` diff --git a/chapter11/docs/example1.gv b/chapter11/docs/example1.gv new file mode 100644 index 00000000..5e059d77 --- /dev/null +++ b/chapter11/docs/example1.gv @@ -0,0 +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; + + 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/chapter11/docs/example1.json b/chapter11/docs/example1.json new file mode 100644 index 00000000..c0c28450 --- /dev/null +++ b/chapter11/docs/example1.json @@ -0,0 +1,31 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example1.svg", + "step": 1, + "roots": [24], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 1, "role": "MEM", "label": null}], "proj": {"par": 1, "idx": 1}}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "DATA", "label": null}], "proj": {"par": 1, "idx": 2}}, + {"id": 5, "label": "new Point", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 6, "label": "#0", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "#42", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 8, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "Store p.y", "type": "MEM#3", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "MemPhi y", "type": "MEM#3", "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 9, "role": "MEM", "label": null}, {"idx": 2, "def": 19, "role": "MEM", "label": null}], "proj": null}, + {"id": 12, "label": "Phi arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 21, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 16, "label": "False", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 1}}, + {"id": 17, "label": "Load p.y", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 0, "role": "DATA", "label": null}], "proj": null}, + {"id": 18, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}, {"idx": 2, "def": 12, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "Store p.y", "type": "MEM#3", "kind": "MEM", "edges": [{"idx": 0, "def": 15, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 18, "role": "DATA", "label": null}], "proj": null}, + {"id": 20, "label": "#1", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 21, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "DATA", "label": null}, {"idx": 2, "def": 20, "role": "DATA", "label": null}], "proj": null}, + {"id": 22, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 8, "role": "MEM", "label": null}, {"idx": 3, "def": 11, "role": "MEM", "label": null}], "proj": null}, + {"id": 23, "label": "Load p.x", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 0, "role": "DATA", "label": null}], "proj": null}, + {"id": 24, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 23, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter11/docs/example1.svg b/chapter11/docs/example1.svg new file mode 100644 index 00000000..46faf818 --- /dev/null +++ b/chapter11/docs/example1.svg @@ -0,0 +1,155 @@ +#6[0] → #1 · ASSOC#7[0] → #1 · ASSOC#8[1] → #3 · MEM#8[2] → #5 · DATA#8[3] → #7 · DATA#9[1] → #3 · MEM#9[2] → #5 · DATA#9[3] → #6 · DATA#11[1] → #9 · MEM#11[2] → #19 · MEM#12[1] → #4 · DATA#12[2] → #21 · DATA#17[0] → #15 · CTRL#17[1] → #11 · MEM#17[2] → #5 · DATA#18[1] → #17 · DATA#18[2] → #12 · DATA#19[0] → #15 · CTRL#19[1] → #11 · MEM#19[2] → #5 · DATA#19[3] → #18 · DATA#20[0] → #1 · ASSOC#21[1] → #12 · DATA#21[2] → #20 · DATA#22[1] → #3 · MEM#22[2] → #8 · MEM#22[3] → #11 · MEM#23[0] → #16 · CTRL#23[1] → #8 · MEM#23[2] → #5 · DATA#24[1] → #22 · MEM#24[2] → #23 · DATAStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMarg  #4/2#4 arg +Projection 2 of #1 +Type not computed + +[0] → #1 DATAnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0#0  #6#6 #0 +Type not computed + +[0] → #1 ASSOC0#42  #7#7 #42 +Type not computed + +[0] → #1 ASSOC0Store p.x  #8MEM#2#8 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #7 DATA0123Store p.y  #9MEM#3#9 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123MemPhi y  #11MEM#3#11 MemPhi y +MEM#3 + +[0] → — ASSOC +[1] → #9 MEM +[2] → #19 MEM012Phi arg  #12#12 Phi arg +Type not computed + +[0] → — ASSOC +[1] → #4 DATA +[2] → #21 DATA012True  #15/0#15 True +Projection 0 of #0 +Type not computed + +False  #16/1#16 False +Projection 1 of #0 +Type not computed + +Load p.y  #17#17 Load p.y +Type not computed + +[0] → #15 CTRL +[1] → #11 MEM +[2] → #5 DATA +[3] → — DATA0123+  #18#18 + +Type not computed + +[0] → — CTRL +[1] → #17 DATA +[2] → #12 DATA012Store p.y  #19MEM#3#19 Store p.y +MEM#3 + +[0] → #15 CTRL +[1] → #11 MEM +[2] → #5 DATA +[3] → #18 DATA0123#1  #20#20 #1 +Type not computed + +[0] → #1 ASSOC0-  #21#21 - +Type not computed + +[0] → — CTRL +[1] → #12 DATA +[2] → #20 DATA012MemMerge  #22#22 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #8 MEM +[3] → #11 MEM0123Load p.x  #23#23 Load p.x +Type not computed + +[0] → #16 CTRL +[1] → #8 MEM +[2] → #5 DATA +[3] → — DATA0123Return  #24#24 Return +Type not computed + +[0] → — CTRL +[1] → #22 MEM +[2] → #23 DATA012 diff --git a/chapter11/docs/example2a.gv b/chapter11/docs/example2a.gv new file mode 100644 index 00000000..187e63b9 --- /dev/null +++ b/chapter11/docs/example2a.gv @@ -0,0 +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; + + 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/chapter11/docs/example2a.json b/chapter11/docs/example2a.json new file mode 100644 index 00000000..b9e84d5a --- /dev/null +++ b/chapter11/docs/example2a.json @@ -0,0 +1,20 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example2a.svg", + "step": 1, + "roots": [11], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 1, "role": "MEM", "label": null}], "proj": {"par": 1, "idx": 1}}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "DATA", "label": null}], "proj": {"par": 1, "idx": 2}}, + {"id": 5, "label": "new Point", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 7, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "#42", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 9, "label": "Store p.y", "type": "MEM#3", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 8, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 7, "role": "MEM", "label": null}, {"idx": 3, "def": 9, "role": "MEM", "label": null}], "proj": null}, + {"id": 11, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter11/docs/example2a.svg b/chapter11/docs/example2a.svg new file mode 100644 index 00000000..b43a55b4 --- /dev/null +++ b/chapter11/docs/example2a.svg @@ -0,0 +1,103 @@ +#7[1] → #3 · MEM#7[2] → #5 · DATA#7[3] → #4 · DATA#8[0] → #1 · ASSOC#9[1] → #3 · MEM#9[2] → #5 · DATA#9[3] → #8 · DATA#10[1] → #3 · MEM#10[2] → #7 · MEM#10[3] → #9 · MEM#11[1] → #10 · MEM#11[2] → #5 · DATAStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMarg  #4/2#4 arg +Projection 2 of #1 +Type not computed + +[0] → #1 DATAnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0Store p.x  #7MEM#2#7 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #4 DATA0123#42  #8#8 #42 +Type not computed + +[0] → #1 ASSOC0Store p.y  #9MEM#3#9 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #8 DATA0123MemMerge  #10#10 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #7 MEM +[3] → #9 MEM0123Return  #11#11 Return +Type not computed + +[0] → — CTRL +[1] → #10 MEM +[2] → #5 DATA012 diff --git a/chapter11/docs/example2b-final.json b/chapter11/docs/example2b-final.json new file mode 100644 index 00000000..b0a7a2f3 --- /dev/null +++ b/chapter11/docs/example2b-final.json @@ -0,0 +1,251 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example2b-final.svg", + "step": 100, + "roots": [ + 23 + ], + "scope": 0, + "nodes": [ + { + "id": 1, + "label": "Start", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": null + }, + { + "id": 3, + "label": "$mem", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "MEM", + "label": null + } + ], + "proj": { + "par": 1, + "idx": 1 + } + }, + { + "id": 5, + "label": "new Point", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + } + ], + "proj": null + }, + { + "id": 6, + "label": "#0", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 8, + "label": "Store p.y", + "type": "MEM#3", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 6, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 13, + "label": "#3", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 15, + "label": "#4", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 22, + "label": "MemMerge", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 27, + "role": "MEM", + "label": null + }, + { + "idx": 3, + "def": 8, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 23, + "label": "Return", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 22, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 27, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 28, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 28, + "label": "Phi x value", + "type": null, + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 13, + "role": "DATA", + "label": null + }, + { + "idx": 2, + "def": 15, + "role": "DATA", + "label": null + } + ], + "proj": null + } + ], + "groups": [] +} diff --git a/chapter11/docs/example2b-final.svg b/chapter11/docs/example2b-final.svg new file mode 100644 index 00000000..163d7fce --- /dev/null +++ b/chapter11/docs/example2b-final.svg @@ -0,0 +1,110 @@ +#6[0] → #1 · ASSOC#8[1] → #3 · MEM#8[2] → #5 · DATA#8[3] → #6 · DATA#13[0] → #1 · ASSOC#15[0] → #1 · ASSOC#22[1] → #3 · MEM#22[2] → #27 · MEM#22[3] → #8 · MEM#23[1] → #22 · MEM#23[2] → #5 · DATA#27[1] → #3 · MEM#27[2] → #5 · DATA#27[3] → #28 · DATA#28[1] → #13 · DATA#28[2] → #15 · DATAStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0#0  #6#6 #0 +Type not computed + +[0] → #1 ASSOC0Store p.y  #8MEM#3#8 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123#3  #13#13 #3 +Type not computed + +[0] → #1 ASSOC0#4  #15#15 #4 +Type not computed + +[0] → #1 ASSOC0MemMerge  #22#22 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #27 MEM +[3] → #8 MEM0123Return  #23#23 Return +Type not computed + +[0] → — CTRL +[1] → #22 MEM +[2] → #5 DATA012Store p.x  #27MEM#2#27 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #28 DATA0123Phi x value  #28#28 Phi x value +Type not computed + +[0] → — ASSOC +[1] → #13 DATA +[2] → #15 DATA012 diff --git a/chapter11/docs/example2b-merged.json b/chapter11/docs/example2b-merged.json new file mode 100644 index 00000000..914b7cfb --- /dev/null +++ b/chapter11/docs/example2b-merged.json @@ -0,0 +1,339 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example2b-merged.svg", + "step": 8, + "roots": [ + 23 + ], + "scope": 0, + "nodes": [ + { + "id": 1, + "label": "Start", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": null + }, + { + "id": 3, + "label": "$mem", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "MEM", + "label": null + } + ], + "proj": { + "par": 1, + "idx": 1 + } + }, + { + "id": 5, + "label": "new Point", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + } + ], + "proj": null + }, + { + "id": 6, + "label": "#0", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 7, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 6, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 8, + "label": "Store p.y", + "type": "MEM#3", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 6, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 11, + "label": "True", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": { + "par": 0, + "idx": 0 + } + }, + { + "id": 12, + "label": "False", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": { + "par": 0, + "idx": 1 + } + }, + { + "id": 13, + "label": "#3", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 14, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 11, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 7, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 13, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 15, + "label": "#4", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 16, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 12, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 7, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 15, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 20, + "label": "MemPhi x", + "type": "MEM#2", + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 14, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 16, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 22, + "label": "MemMerge", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 20, + "role": "MEM", + "label": null + }, + { + "idx": 3, + "def": 8, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 23, + "label": "Return", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 22, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + } + ], + "proj": null + } + ], + "groups": [] +} diff --git a/chapter11/docs/example2b-merged.svg b/chapter11/docs/example2b-merged.svg new file mode 100644 index 00000000..21ae615e --- /dev/null +++ b/chapter11/docs/example2b-merged.svg @@ -0,0 +1,130 @@ +#6[0] → #1 · ASSOC#7[1] → #3 · MEM#7[2] → #5 · DATA#7[3] → #6 · DATA#8[1] → #3 · MEM#8[2] → #5 · DATA#8[3] → #6 · DATA#13[0] → #1 · ASSOC#14[0] → #11 · CTRL#14[1] → #7 · MEM#14[2] → #5 · DATA#14[3] → #13 · DATA#15[0] → #1 · ASSOC#16[0] → #12 · CTRL#16[1] → #7 · MEM#16[2] → #5 · DATA#16[3] → #15 · DATA#20[1] → #14 · MEM#20[2] → #16 · MEM#22[1] → #3 · MEM#22[2] → #20 · MEM#22[3] → #8 · MEM#23[1] → #22 · MEM#23[2] → #5 · DATAStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0#0  #6#6 #0 +Type not computed + +[0] → #1 ASSOC0Store p.x  #7MEM#2#7 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123Store p.y  #8MEM#3#8 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123True  #11/0#11 True +Projection 0 of #0 +Type not computed + +False  #12/1#12 False +Projection 1 of #0 +Type not computed + +#3  #13#13 #3 +Type not computed + +[0] → #1 ASSOC0Store p.x  #14MEM#2#14 Store p.x +MEM#2 + +[0] → #11 CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #13 DATA0123#4  #15#15 #4 +Type not computed + +[0] → #1 ASSOC0Store p.x  #16MEM#2#16 Store p.x +MEM#2 + +[0] → #12 CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #15 DATA0123MemPhi x  #20MEM#2#20 MemPhi x +MEM#2 + +[0] → — ASSOC +[1] → #14 MEM +[2] → #16 MEM012MemMerge  #22#22 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #20 MEM +[3] → #8 MEM0123Return  #23#23 Return +Type not computed + +[0] → — CTRL +[1] → #22 MEM +[2] → #5 DATA012 diff --git a/chapter11/docs/example2b-split-y.json b/chapter11/docs/example2b-split-y.json new file mode 100644 index 00000000..fc3c8758 --- /dev/null +++ b/chapter11/docs/example2b-split-y.json @@ -0,0 +1,486 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example2b-split-y.svg", + "step": 3, + "roots": [ + 23 + ], + "scope": 0, + "nodes": [ + { + "id": 1, + "label": "Start", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": null + }, + { + "id": 3, + "label": "$mem", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "MEM", + "label": null + } + ], + "proj": { + "par": 1, + "idx": 1 + } + }, + { + "id": 5, + "label": "new Point", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + } + ], + "proj": null + }, + { + "id": 6, + "label": "#0", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 7, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 6, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 8, + "label": "Store p.y", + "type": "MEM#3", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 6, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 11, + "label": "True", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": { + "par": 0, + "idx": 0 + } + }, + { + "id": 12, + "label": "False", + "type": null, + "kind": "CTRL", + "edges": [], + "proj": { + "par": 0, + "idx": 1 + } + }, + { + "id": 13, + "label": "#3", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 14, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 11, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 7, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 13, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 15, + "label": "#4", + "type": null, + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 1, + "role": "ASSOC", + "label": null + } + ], + "proj": null + }, + { + "id": 16, + "label": "Store p.x", + "type": "MEM#2", + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 12, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 7, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 15, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 17, + "label": "MemMerge", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 14, + "role": "MEM", + "label": null + }, + { + "idx": 3, + "def": 8, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 18, + "label": "MemMerge", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 3, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 16, + "role": "MEM", + "label": null + }, + { + "idx": 3, + "def": 8, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 20, + "label": "MemPhi x", + "type": "MEM#2", + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 14, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 16, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 22, + "label": "MemMerge", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 26, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 20, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 23, + "label": "Return", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 22, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 5, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 24, + "label": "MemPhi y", + "type": "MEM#3", + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 8, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 8, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 25, + "label": "BulkMemPhi except x,y", + "type": null, + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 17, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 18, + "role": "MEM", + "label": null + } + ], + "proj": null + }, + { + "id": 26, + "label": "MemMerge", + "type": null, + "kind": "MEM", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 25, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 20, + "role": "MEM", + "label": null + }, + { + "idx": 3, + "def": 24, + "role": "MEM", + "label": null + } + ], + "proj": null + } + ], + "groups": [] +} diff --git a/chapter11/docs/example2b-split-y.svg b/chapter11/docs/example2b-split-y.svg new file mode 100644 index 00000000..f4d4b9b6 --- /dev/null +++ b/chapter11/docs/example2b-split-y.svg @@ -0,0 +1,157 @@ +#6[0] → #1 · ASSOC#7[1] → #3 · MEM#7[2] → #5 · DATA#7[3] → #6 · DATA#8[1] → #3 · MEM#8[2] → #5 · DATA#8[3] → #6 · DATA#13[0] → #1 · ASSOC#14[0] → #11 · CTRL#14[1] → #7 · MEM#14[2] → #5 · DATA#14[3] → #13 · DATA#15[0] → #1 · ASSOC#16[0] → #12 · CTRL#16[1] → #7 · MEM#16[2] → #5 · DATA#16[3] → #15 · DATA#17[1] → #3 · MEM#17[2] → #14 · MEM#17[3] → #8 · MEM#18[1] → #3 · MEM#18[2] → #16 · MEM#18[3] → #8 · MEM#20[1] → #14 · MEM#20[2] → #16 · MEM#22[1] → #26 · MEM#22[2] → #20 · MEM#23[1] → #22 · MEM#23[2] → #5 · DATA#24[1] → #8 · MEM#24[2] → #8 · MEM#25[1] → #17 · MEM#25[2] → #18 · MEM#26[1] → #25 · MEM#26[2] → #20 · MEM#26[3] → #24 · MEMStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0#0  #6#6 #0 +Type not computed + +[0] → #1 ASSOC0Store p.x  #7MEM#2#7 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123Store p.y  #8MEM#3#8 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123True  #11/0#11 True +Projection 0 of #0 +Type not computed + +False  #12/1#12 False +Projection 1 of #0 +Type not computed + +#3  #13#13 #3 +Type not computed + +[0] → #1 ASSOC0Store p.x  #14MEM#2#14 Store p.x +MEM#2 + +[0] → #11 CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #13 DATA0123#4  #15#15 #4 +Type not computed + +[0] → #1 ASSOC0Store p.x  #16MEM#2#16 Store p.x +MEM#2 + +[0] → #12 CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #15 DATA0123MemMerge  #17#17 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #14 MEM +[3] → #8 MEM0123MemMerge  #18#18 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #16 MEM +[3] → #8 MEM0123MemPhi x  #20MEM#2#20 MemPhi x +MEM#2 + +[0] → — ASSOC +[1] → #14 MEM +[2] → #16 MEM012MemMerge  #22#22 MemMerge +Type not computed + +[0] → — CTRL +[1] → #26 MEM +[2] → #20 MEM012Return  #23#23 Return +Type not computed + +[0] → — CTRL +[1] → #22 MEM +[2] → #5 DATA012MemPhi y  #24MEM#3#24 MemPhi y +MEM#3 + +[0] → — ASSOC +[1] → #8 MEM +[2] → #8 MEM012BulkMemPhi except x,y  #25#25 BulkMemPhi except x,y +Type not computed + +[0] → — ASSOC +[1] → #17 MEM +[2] → #18 MEM012MemMerge  #26#26 MemMerge +Type not computed + +[0] → — CTRL +[1] → #25 MEM +[2] → #20 MEM +[3] → #24 MEM0123 diff --git a/chapter11/docs/example2b.gv b/chapter11/docs/example2b.gv new file mode 100644 index 00000000..39b87a6a --- /dev/null +++ b/chapter11/docs/example2b.gv @@ -0,0 +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; + + 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/chapter11/docs/example2b.json b/chapter11/docs/example2b.json new file mode 100644 index 00000000..702773ea --- /dev/null +++ b/chapter11/docs/example2b.json @@ -0,0 +1,30 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example2b.svg", + "step": 1, + "roots": [23], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 1, "role": "MEM", "label": null}], "proj": {"par": 1, "idx": 1}}, + {"id": 5, "label": "new Point", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 6, "label": "#0", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "Store p.y", "type": "MEM#3", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 7, "role": "MEM", "label": null}, {"idx": 3, "def": 8, "role": "MEM", "label": null}], "proj": null}, + {"id": 11, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 12, "label": "False", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 1}}, + {"id": 13, "label": "#3", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 14, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 13, "role": "DATA", "label": null}], "proj": null}, + {"id": 15, "label": "#4", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 16, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 15, "role": "DATA", "label": null}], "proj": null}, + {"id": 17, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null}, + {"id": 18, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "MEM", "label": null}], "proj": null}, + {"id": 20, "label": "MemPhi x", "type": "MEM#2", "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 16, "role": "MEM", "label": null}], "proj": null}, + {"id": 21, "label": "BulkMemPhi except x", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 17, "role": "MEM", "label": null}, {"idx": 2, "def": 18, "role": "MEM", "label": null}], "proj": null}, + {"id": 22, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 21, "role": "MEM", "label": null}, {"idx": 2, "def": 20, "role": "MEM", "label": null}], "proj": null}, + {"id": 23, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter11/docs/example2b.svg b/chapter11/docs/example2b.svg new file mode 100644 index 00000000..54ddad9d --- /dev/null +++ b/chapter11/docs/example2b.svg @@ -0,0 +1,150 @@ +#6[0] → #1 · ASSOC#7[1] → #3 · MEM#7[2] → #5 · DATA#7[3] → #6 · DATA#8[1] → #3 · MEM#8[2] → #5 · DATA#8[3] → #6 · DATA#9[1] → #3 · MEM#9[2] → #7 · MEM#9[3] → #8 · MEM#13[0] → #1 · ASSOC#14[0] → #11 · CTRL#14[1] → #7 · MEM#14[2] → #5 · DATA#14[3] → #13 · DATA#15[0] → #1 · ASSOC#16[0] → #12 · CTRL#16[1] → #7 · MEM#16[2] → #5 · DATA#16[3] → #15 · DATA#17[1] → #9 · MEM#17[2] → #14 · MEM#18[1] → #9 · MEM#18[2] → #16 · MEM#20[1] → #14 · MEM#20[2] → #16 · MEM#21[1] → #17 · MEM#21[2] → #18 · MEM#22[1] → #21 · MEM#22[2] → #20 · MEM#23[1] → #22 · MEM#23[2] → #5 · DATAStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0#0  #6#6 #0 +Type not computed + +[0] → #1 ASSOC0Store p.x  #7MEM#2#7 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123Store p.y  #8MEM#3#8 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123MemMerge  #9#9 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #7 MEM +[3] → #8 MEM0123True  #11/0#11 True +Projection 0 of #0 +Type not computed + +False  #12/1#12 False +Projection 1 of #0 +Type not computed + +#3  #13#13 #3 +Type not computed + +[0] → #1 ASSOC0Store p.x  #14MEM#2#14 Store p.x +MEM#2 + +[0] → #11 CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #13 DATA0123#4  #15#15 #4 +Type not computed + +[0] → #1 ASSOC0Store p.x  #16MEM#2#16 Store p.x +MEM#2 + +[0] → #12 CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #15 DATA0123MemMerge  #17#17 MemMerge +Type not computed + +[0] → — CTRL +[1] → #9 MEM +[2] → #14 MEM012MemMerge  #18#18 MemMerge +Type not computed + +[0] → — CTRL +[1] → #9 MEM +[2] → #16 MEM012MemPhi x  #20MEM#2#20 MemPhi x +MEM#2 + +[0] → — ASSOC +[1] → #14 MEM +[2] → #16 MEM012BulkMemPhi except x  #21#21 BulkMemPhi except x +Type not computed + +[0] → — ASSOC +[1] → #17 MEM +[2] → #18 MEM012MemMerge  #22#22 MemMerge +Type not computed + +[0] → — CTRL +[1] → #21 MEM +[2] → #20 MEM012Return  #23#23 Return +Type not computed + +[0] → — CTRL +[1] → #22 MEM +[2] → #5 DATA012 diff --git a/chapter11/docs/example2c.gv b/chapter11/docs/example2c.gv new file mode 100644 index 00000000..b32d186d --- /dev/null +++ b/chapter11/docs/example2c.gv @@ -0,0 +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; + + 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/chapter11/docs/example2c.json b/chapter11/docs/example2c.json new file mode 100644 index 00000000..c25fa5b8 --- /dev/null +++ b/chapter11/docs/example2c.json @@ -0,0 +1,23 @@ +{ + "ver": 1, + "comp": "chapter11/docs/example2c.svg", + "step": 1, + "roots": [13], + "scope": 0, + "nodes": [ + {"id": 1, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, + {"id": 3, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 1, "role": "MEM", "label": null}], "proj": {"par": 1, "idx": 1}}, + {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "DATA", "label": null}], "proj": {"par": 1, "idx": 2}}, + {"id": 5, "label": "new Point", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, + {"id": 6, "label": "#0", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 1, "role": "ASSOC", "label": null}], "proj": null}, + {"id": 7, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 8, "label": "Store p.y", "type": "MEM#3", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "Load p.x", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 0, "role": "DATA", "label": null}], "proj": null}, + {"id": 10, "label": "Store p.x", "type": "MEM#2", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 7, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 11, "label": "Store p.y", "type": "MEM#3", "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "MEM", "label": null}, {"idx": 2, "def": 5, "role": "DATA", "label": null}, {"idx": 3, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 12, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 3, "role": "MEM", "label": null}, {"idx": 2, "def": 10, "role": "MEM", "label": null}, {"idx": 3, "def": 11, "role": "MEM", "label": null}], "proj": null}, + {"id": 13, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 12, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null} + ], + "groups": [ + ] +} diff --git a/chapter11/docs/example2c.svg b/chapter11/docs/example2c.svg new file mode 100644 index 00000000..01bbe10a --- /dev/null +++ b/chapter11/docs/example2c.svg @@ -0,0 +1,121 @@ +#6[0] → #1 · ASSOC#7[1] → #3 · MEM#7[2] → #5 · DATA#7[3] → #6 · DATA#8[1] → #3 · MEM#8[2] → #5 · DATA#8[3] → #6 · DATA#9[1] → #7 · MEM#9[2] → #5 · DATA#10[1] → #7 · MEM#10[2] → #5 · DATA#10[3] → #4 · DATA#11[1] → #8 · MEM#11[2] → #5 · DATA#11[3] → #4 · DATA#12[1] → #3 · MEM#12[2] → #10 · MEM#12[3] → #11 · MEM#13[1] → #12 · MEM#13[2] → #9 · DATAStart  #1#1 Start +Type not computed + +$mem  #3/1#3 $mem +Projection 1 of #1 +Type not computed + +[0] → #1 MEMarg  #4/2#4 arg +Projection 2 of #1 +Type not computed + +[0] → #1 DATAnew Point  #5#5 new Point +Type not computed + +[0] → — CTRL0#0  #6#6 #0 +Type not computed + +[0] → #1 ASSOC0Store p.x  #7MEM#2#7 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123Store p.y  #8MEM#3#8 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #3 MEM +[2] → #5 DATA +[3] → #6 DATA0123Load p.x  #9#9 Load p.x +Type not computed + +[0] → — CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → — DATA0123Store p.x  #10MEM#2#10 Store p.x +MEM#2 + +[0] → — CTRL +[1] → #7 MEM +[2] → #5 DATA +[3] → #4 DATA0123Store p.y  #11MEM#3#11 Store p.y +MEM#3 + +[0] → — CTRL +[1] → #8 MEM +[2] → #5 DATA +[3] → #4 DATA0123MemMerge  #12#12 MemMerge +Type not computed + +[0] → — CTRL +[1] → #3 MEM +[2] → #10 MEM +[3] → #11 MEM0123Return  #13#13 Return +Type not computed + +[0] → — CTRL +[1] → #12 MEM +[2] → #9 DATA012 diff --git a/chapter11/docs/graph1.gv b/chapter11/docs/graph1.gv deleted file mode 100644 index 3554a572..00000000 --- a/chapter11/docs/graph1.gv +++ /dev/null @@ -1,79 +0,0 @@ -digraph chapter11 { -/* -struct S { int f; } -S v=new S; -v.f = 2; -int i=new S.f; -i=v.f; -if (arg) v.f=1; -return i; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$memarg
-
> - ]; - MemMerge [ shape=box label="MemMerge" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - new9 [ label="new S" ]; - Con_11 [ label="#2" ]; - Store12 [ label=".f =" ]; - new13 [ label="new S" ]; - Store14 [ label=".f =" ]; - Load16 [ label=".f" ]; - If17 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Con_21 [ label="#1" ]; - Store22 [ label=".f =" ]; - Region23 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_224 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Return25 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Region23;Phi_224;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return25[taillabel=0 color=red]; - new9 -> Start2:p0[taillabel=0 color=green]; - Store12 -> Start2:p1[taillabel=1 color=blue]; - Store12 -> new9[taillabel=2]; - Store12 -> Con_11[taillabel=3]; - new13 -> Start2:p0[taillabel=0 color=green]; - Store14 -> Store12[taillabel=1 color=blue]; - Store14 -> new13[taillabel=2]; - Store14 -> Con_4[taillabel=3]; - Load16 -> Store14[taillabel=1 color=blue]; - Load16 -> new9[taillabel=2]; - If17 -> Start2:p0[taillabel=0 color=red]; - If17 -> Start2:p2[taillabel=1]; - Store22 -> Store14[taillabel=1 color=blue]; - Store22 -> new9[taillabel=2]; - Store22 -> Con_21[taillabel=3]; - Region23 -> If17:p0[taillabel=1 color=red]; - Region23 -> If17:p1[taillabel=2 color=red]; - Phi_224 -> Region23 [style=dotted taillabel=0]; - Phi_224 -> Store22[taillabel=1 color=blue]; - Phi_224 -> Store14[taillabel=2 color=blue constraint=false]; - Return25 -> Region23[taillabel=0 color=red]; - Return25 -> Load16[taillabel=2]; - Return25 -> MemMerge[taillabel=1 color=blue]; - MemMerge -> Start2:p1[taillabel=1 color=blue]; - MemMerge -> Phi_224[taillabel=2 color=blue]; -} diff --git a/chapter11/docs/graph1.json b/chapter11/docs/graph1.json deleted file mode 100644 index 2d58e0ba..00000000 --- a/chapter11/docs/graph1.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph1.svg", - "step": 1, - "roots": [25], - "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": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, - {"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": 0, "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": 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": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "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": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} - ], - "groups": [ - ] -} diff --git a/chapter11/docs/graph1.svg b/chapter11/docs/graph1.svg deleted file mode 100644 index 93a2a03f..00000000 --- a/chapter11/docs/graph1.svg +++ /dev/null @@ -1,123 +0,0 @@ -#1[1] → #6 · MEM#1[2] → #224 · MEM#12[1] → #6 · MEM#12[2] → #9 · DATA#12[3] → #11 · DATA#14[1] → #12 · MEM#14[2] → #13 · DATA#14[3] → #4 · DATA#16[1] → #14 · MEM#16[2] → #9 · DATA#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#25[1] → #1 · MEM#25[2] → #16 · DATA#224[1] → #22 · MEM#224[2] → #14 · MEMMemMerge  #1#1 MemMerge -Type not computed - -[0] → — DATA -[1] → #6 MEM -[2] → #224 MEM012Start  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -$mem  #6/1#6 $mem -Projection 1 of #2 -Type not computed - -[0] → #2 MEMnew S  #9#9 new S -Type not computed - -[0] → — CTRL0#2  #11#11 #2 -Type not computed - -.f =  #12#12 .f = -Type not computed - -[0] → — DATA -[1] → #6 MEM -[2] → #9 DATA -[3] → #11 DATA0123new S  #13#13 new S -Type not computed - -[0] → — CTRL0.f =  #14#14 .f = -Type not computed - -[0] → — DATA -[1] → #12 MEM -[2] → #13 DATA -[3] → #4 DATA0123.f  #16#16 .f -Type not computed - -[0] → — DATA -[1] → #14 MEM -[2] → #9 DATA012#1  #21#21 #1 -Type not computed - -.f =  #22#22 .f = -Type not computed - -[0] → — DATA -[1] → #14 MEM -[2] → #9 DATA -[3] → #21 DATA0123Return  #25#25 Return -Type not computed - -[0] → — CTRL -[1] → #1 MEM -[2] → #16 DATA012MemPhi_2  #224#224 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #22 MEM -[2] → #14 MEM012 diff --git a/chapter11/docs/graph2.gv b/chapter11/docs/graph2.gv deleted file mode 100644 index 730cf845..00000000 --- a/chapter11/docs/graph2.gv +++ /dev/null @@ -1,84 +0,0 @@ -digraph chapter11 { -/* -struct S { int f; } -S v=new S; -v.f = 2; -int i=new S.f; -i=v.f; -if (arg) v.f=1; -return i; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$memarg
-
> - ]; - MemMerge [ shape=box label="MemMerge" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - new9 [ label="new S" ]; - Con_11 [ label="#2" ]; - Store12 [ label=".f =" ]; - new13 [ label="new S" ]; - Store14 [ label=".f =" ]; - Load16 [ label=".f" ]; - If17 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Con_21 [ label="#1" ]; - Store22 [ label=".f =" ]; - Region23 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_224 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Return25 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Region23;Phi_224;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return25[taillabel=0 color=red]; - new9 -> Start2:p0[taillabel=0 color=green]; - Store12 -> Start2:p0[taillabel=0 color=red]; - Store12 -> Start2:p1[taillabel=1 color=blue]; - Store12 -> new9[taillabel=2]; - Store12 -> Con_11[taillabel=3]; - new13 -> Start2:p0[taillabel=0 color=green]; - Store14 -> Start2:p0[taillabel=0 color=red]; - Store14 -> Store12[taillabel=1 color=blue]; - Store14 -> new13[taillabel=2]; - Store14 -> Con_4[taillabel=3]; - Load16 -> Start2:p0[taillabel=0 color=red]; - Load16 -> Store14[taillabel=1 color=blue]; - Load16 -> new9[taillabel=2]; - If17 -> Start2:p0[taillabel=0 color=red]; - If17 -> Start2:p2[taillabel=1]; - Store22 -> Start2:p0[taillabel=0 color=red]; - Store22 -> Store14[taillabel=1 color=blue]; - Store22 -> new9[taillabel=2]; - Store22 -> Con_21[taillabel=3]; - Region23 -> If17:p0[taillabel=1 color=red]; - Region23 -> If17:p1[taillabel=2 color=red]; - Phi_224 -> Region23 [style=dotted taillabel=0]; - Phi_224 -> Store22[taillabel=1 color=blue]; - Phi_224 -> Store14[taillabel=2 color=blue constraint=false]; - Return25 -> Region23[taillabel=0 color=red]; - Return25 -> Load16[taillabel=2]; - Return25 -> MemMerge[taillabel=1 color=blue]; - MemMerge -> Start2:p1[taillabel=1 color=blue]; - MemMerge -> Phi_224[taillabel=2 color=blue]; - MemMerge -> Region23[taillabel=0 color=green]; -} diff --git a/chapter11/docs/graph2.json b/chapter11/docs/graph2.json deleted file mode 100644 index 602c1584..00000000 --- a/chapter11/docs/graph2.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph2.svg", - "step": 1, - "roots": [25], - "scope": 0, - "nodes": [ - {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, - {"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": "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": 0, "role": "CTRL", "label": null}], "proj": null}, - {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "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": "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": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "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": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} - ], - "groups": [ - ] -} diff --git a/chapter11/docs/graph2.svg b/chapter11/docs/graph2.svg deleted file mode 100644 index 05210749..00000000 --- a/chapter11/docs/graph2.svg +++ /dev/null @@ -1,123 +0,0 @@ -#1[1] → #6 · MEM#1[2] → #224 · MEM#12[1] → #6 · MEM#12[2] → #9 · DATA#12[3] → #11 · DATA#14[1] → #12 · MEM#14[2] → #13 · DATA#14[3] → #4 · DATA#16[1] → #14 · MEM#16[2] → #9 · DATA#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#25[1] → #1 · MEM#25[2] → #16 · DATA#224[1] → #22 · MEM#224[2] → #14 · MEMMemMerge  #1#1 MemMerge -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #224 MEM012Start  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -$mem  #6/1#6 $mem -Projection 1 of #2 -Type not computed - -[0] → #2 MEMnew S  #9#9 new S -Type not computed - -[0] → — CTRL0#2  #11#11 #2 -Type not computed - -.f =  #12#12 .f = -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #9 DATA -[3] → #11 DATA0123new S  #13#13 new S -Type not computed - -[0] → — CTRL0.f =  #14#14 .f = -Type not computed - -[0] → — CTRL -[1] → #12 MEM -[2] → #13 DATA -[3] → #4 DATA0123.f  #16#16 .f -Type not computed - -[0] → — CTRL -[1] → #14 MEM -[2] → #9 DATA012#1  #21#21 #1 -Type not computed - -.f =  #22#22 .f = -Type not computed - -[0] → — CTRL -[1] → #14 MEM -[2] → #9 DATA -[3] → #21 DATA0123Return  #25#25 Return -Type not computed - -[0] → — CTRL -[1] → #1 MEM -[2] → #16 DATA012MemPhi_2  #224#224 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #22 MEM -[2] → #14 MEM012 diff --git a/chapter11/docs/graph3-snip.jpg b/chapter11/docs/graph3-snip.jpg deleted file mode 100644 index 804a32c4..00000000 Binary files a/chapter11/docs/graph3-snip.jpg and /dev/null differ diff --git a/chapter11/docs/graph3-snip.json b/chapter11/docs/graph3-snip.json deleted file mode 100644 index 7dade538..00000000 --- a/chapter11/docs/graph3-snip.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph3-snip.svg", - "step": 1, - "roots": [22], - "scope": 0, - "nodes": [ - {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, - {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, - {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "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 deleted file mode 100644 index 9f5218af..00000000 --- a/chapter11/docs/graph3-snip.svg +++ /dev/null @@ -1,91 +0,0 @@ -#16[1] → #14 · MEM#16[2] → #9 · DATA#22[0] → #8 · CTRL#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#22[4] → #16 · DATATrue  #8/0#8 True -Projection 0 of #0 -Type not computed - -new S  #9#9 new S -Type not computed - -[0] → — CTRL0.f =  #14#14 .f = -Type not computed - -[0] → — CTRL -[1] → — MEM -[2] → — DATA -[3] → — DATA0123.f  #16#16 .f -Type not computed - -[0] → — CTRL -[1] → #14 MEM -[2] → #9 DATA012#1  #21#21 #1 -Type not computed - -.f =  #22#22 .f = -Type not computed - -[0] → #8 CTRL -[1] → #14 MEM -[2] → #9 DATA -[3] → #21 DATA -[4] → #16 DATA01234 diff --git a/chapter11/docs/graph3.gv b/chapter11/docs/graph3.gv deleted file mode 100644 index d89d0ed4..00000000 --- a/chapter11/docs/graph3.gv +++ /dev/null @@ -1,85 +0,0 @@ -digraph chapter11 { -/* -struct S { int f; } -S v=new S; -v.f = 2; -int i=new S.f; -i=v.f; -if (arg) v.f=1; -return i; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$memarg
-
> - ]; - MemMerge [ shape=box label="MemMerge" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - new9 [ label="new S" ]; - Con_11 [ label="#2" ]; - Store12 [ label=".f =" ]; - new13 [ label="new S" ]; - Store14 [ label=".f =" ]; - Load16 [ label=".f" ]; - If17 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Con_21 [ label="#1" ]; - Store22 [ label=".f =" ]; - Region23 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_224 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Return25 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Region23;Phi_224;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return25[taillabel=0 color=red]; - new9 -> Start2:p0[taillabel=0 color=green]; - Store12 -> Start2:p0[taillabel=0 color=red]; - Store12 -> Start2:p1[taillabel=1 color=blue]; - Store12 -> new9[taillabel=2]; - Store12 -> Con_11[taillabel=3]; - new13 -> Start2:p0[taillabel=0 color=green]; - Store14 -> Start2:p0[taillabel=0 color=red]; - Store14 -> Store12[taillabel=1 color=blue]; - Store14 -> new13[taillabel=2]; - Store14 -> Con_4[taillabel=3]; - Load16 -> Start2:p0[taillabel=0 color=red]; - Load16 -> Store14[taillabel=1 color=blue]; - Load16 -> new9[taillabel=2]; - If17 -> Start2:p0[taillabel=0 color=red]; - If17 -> Start2:p2[taillabel=1]; - Store22 -> If17:p0[taillabel=0 color=red]; - Store22 -> Store14[taillabel=1 color=blue]; - Store22 -> new9[taillabel=2]; - Store22 -> Con_21[taillabel=3]; - Store22 -> Load16[taillabel=4]; - Region23 -> If17:p0[taillabel=1 color=red]; - Region23 -> If17:p1[taillabel=2 color=red]; - Phi_224 -> Region23 [style=dotted taillabel=0]; - Phi_224 -> Store22[taillabel=1 color=blue]; - Phi_224 -> Store14[taillabel=2 color=blue constraint=false]; - Return25 -> Region23[taillabel=0 color=red]; - Return25 -> Load16[taillabel=2]; - Return25 -> MemMerge[taillabel=1 color=blue]; - MemMerge -> Start2:p1[taillabel=1 color=blue]; - MemMerge -> Phi_224[taillabel=2 color=blue]; - MemMerge -> Region23[taillabel=0 color=green]; -} diff --git a/chapter11/docs/graph3.json b/chapter11/docs/graph3.json deleted file mode 100644 index 577d7c3b..00000000 --- a/chapter11/docs/graph3.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph3.svg", - "step": 1, - "roots": [25], - "scope": 0, - "nodes": [ - {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 6, "label": "$mem", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 2, "role": "MEM", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 8, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, - {"id": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, - {"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": "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": 0, "role": "CTRL", "label": null}], "proj": null}, - {"id": 14, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 14, "role": "MEM", "label": null}, {"idx": 2, "def": 9, "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": 25, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "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": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 22, "role": "MEM", "label": null}, {"idx": 2, "def": 14, "role": "MEM", "label": null}], "proj": null} - ], - "groups": [ - ] -} diff --git a/chapter11/docs/graph3.svg b/chapter11/docs/graph3.svg deleted file mode 100644 index 0247b5c6..00000000 --- a/chapter11/docs/graph3.svg +++ /dev/null @@ -1,128 +0,0 @@ -#1[1] → #6 · MEM#1[2] → #224 · MEM#12[1] → #6 · MEM#12[2] → #9 · DATA#12[3] → #11 · DATA#14[1] → #12 · MEM#14[2] → #13 · DATA#14[3] → #4 · DATA#16[1] → #14 · MEM#16[2] → #9 · DATA#22[0] → #8 · CTRL#22[1] → #14 · MEM#22[2] → #9 · DATA#22[3] → #21 · DATA#22[4] → #16 · DATA#25[1] → #1 · MEM#25[2] → #16 · DATA#224[1] → #22 · MEM#224[2] → #14 · MEMMemMerge  #1#1 MemMerge -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #224 MEM012Start  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -$mem  #6/1#6 $mem -Projection 1 of #2 -Type not computed - -[0] → #2 MEMTrue  #8/0#8 True -Projection 0 of #0 -Type not computed - -new S  #9#9 new S -Type not computed - -[0] → — CTRL0#2  #11#11 #2 -Type not computed - -.f =  #12#12 .f = -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #9 DATA -[3] → #11 DATA0123new S  #13#13 new S -Type not computed - -[0] → — CTRL0.f =  #14#14 .f = -Type not computed - -[0] → — CTRL -[1] → #12 MEM -[2] → #13 DATA -[3] → #4 DATA0123.f  #16#16 .f -Type not computed - -[0] → — CTRL -[1] → #14 MEM -[2] → #9 DATA012#1  #21#21 #1 -Type not computed - -.f =  #22#22 .f = -Type not computed - -[0] → #8 CTRL -[1] → #14 MEM -[2] → #9 DATA -[3] → #21 DATA -[4] → #16 DATA01234Return  #25#25 Return -Type not computed - -[0] → — CTRL -[1] → #1 MEM -[2] → #16 DATA012MemPhi_2  #224#224 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #22 MEM -[2] → #14 MEM012 diff --git a/chapter11/docs/graph4.gv b/chapter11/docs/graph4.gv deleted file mode 100644 index cf622aa1..00000000 --- a/chapter11/docs/graph4.gv +++ /dev/null @@ -1,110 +0,0 @@ -digraph chapter11 { -/* -struct S { int f; } -S v = new S; -int i = arg; -while (arg > 0) { - int j = i/3; - if (arg == 5) - v.f = j; - arg = arg - 1; -} -return v; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$memarg
-
> - ]; - MemMerge [ shape=box label="MemMerge" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - new9 [ label="new S" ]; - Store10 [ label=".f =" ]; - Loop11 [ shape=box style=filled fillcolor=yellow label="Loop" ]; - Phi_arg13 [ style=filled fillcolor=lightyellow label="φ_arg" ]; - LT14 [ label="<" ]; - If16 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Div21 [ label="//" ]; - Con_22 [ label="#3" ]; - EQ23 [ label="==" ]; - Con_24 [ label="#5" ]; - If25 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Phi_230 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Store31 [ label=".f =" ]; - Region32 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_233 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Sub35 [ label="-" ]; - Con_36 [ label="#1" ]; - Return37 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Loop11;Phi_230;Phi_arg13;} - { rank=same; Region32;Phi_233;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return37[taillabel=0 color=red]; - new9 -> Start2:p0[taillabel=0 color=green]; - Store10 -> Start2:p1[taillabel=1 color=blue]; - Store10 -> new9[taillabel=2]; - Store10 -> Con_4[taillabel=3]; - Loop11 -> Start2:p0[taillabel=1 color=red]; - Loop11 -> Region32[taillabel=2 color=red constraint=false]; - Phi_arg13 -> Loop11 [style=dotted taillabel=0]; - Phi_arg13 -> Start2:p2[taillabel=1]; - Phi_arg13 -> Sub35[taillabel=2 constraint=false]; - LT14 -> Con_4[taillabel=1]; - LT14 -> Phi_arg13[taillabel=2]; - If16 -> Loop11[taillabel=0 color=red]; - If16 -> LT14[taillabel=1]; - Div21 -> Start2:p2[taillabel=1]; - Div21 -> Con_22[taillabel=2]; - EQ23 -> Phi_arg13[taillabel=1]; - EQ23 -> Con_24[taillabel=2]; - If25 -> If16:p0[taillabel=0 color=red]; - If25 -> EQ23[taillabel=1]; - Phi_230 -> Loop11 [style=dotted taillabel=0]; - Phi_230 -> Store10[taillabel=1 color=blue]; - Phi_230 -> Phi_233[taillabel=2 color=blue constraint=false]; - Store31 -> Phi_230[taillabel=1 color=blue]; - Store31 -> new9[taillabel=2]; - Store31 -> Div21[taillabel=3]; - Region32 -> If25:p0[taillabel=1 color=red]; - Region32 -> If25:p1[taillabel=2 color=red]; - Phi_233 -> Region32 [style=dotted taillabel=0]; - Phi_233 -> Store31[taillabel=1 color=blue]; - Phi_233 -> Phi_230[taillabel=2 color=blue constraint=false]; - Sub35 -> Phi_arg13[taillabel=1]; - Sub35 -> Con_36[taillabel=2]; - Return37 -> If16:p1[taillabel=0 color=red]; - Return37 -> new9[taillabel=2]; - Return37 -> MemMerge[taillabel=1 color=blue]; - MemMerge -> Start2:p1[taillabel=1 color=blue]; - MemMerge -> Phi_230[taillabel=2 color=blue]; -} diff --git a/chapter11/docs/graph4.json b/chapter11/docs/graph4.json deleted file mode 100644 index 44c1c055..00000000 --- a/chapter11/docs/graph4.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph4.svg", - "step": 1, - "roots": [37], - "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": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"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": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "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": 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": 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": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "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": 0, "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": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} - ], - "groups": [ - ] -} diff --git a/chapter11/docs/graph4.svg b/chapter11/docs/graph4.svg deleted file mode 100644 index 9ca92879..00000000 --- a/chapter11/docs/graph4.svg +++ /dev/null @@ -1,120 +0,0 @@ -#1[1] → #6 · MEM#1[2] → #230 · MEM#10[1] → #6 · MEM#10[2] → #9 · DATA#10[3] → #4 · DATA#21[1] → #7 · DATA#21[2] → #22 · DATA#31[1] → #230 · MEM#31[2] → #9 · DATA#31[3] → #21 · DATA#37[1] → #1 · MEM#37[2] → #9 · DATA#230[1] → #10 · MEM#230[2] → #233 · MEM#233[1] → #31 · MEM#233[2] → #230 · MEMMemMerge  #1#1 MemMerge -Type not computed - -[0] → — DATA -[1] → #6 MEM -[2] → #230 MEM012Start  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -$mem  #6/1#6 $mem -Projection 1 of #2 -Type not computed - -[0] → #2 MEMarg  #7/2#7 arg -Projection 2 of #2 -Type not computed - -[0] → #2 DATAnew S  #9#9 new S -Type not computed - -[0] → — CTRL0.f =  #10#10 .f = -Type not computed - -[0] → — DATA -[1] → #6 MEM -[2] → #9 DATA -[3] → #4 DATA0123//  #21#21 // -Type not computed - -[0] → — DATA -[1] → #7 DATA -[2] → #22 DATA012#3  #22#22 #3 -Type not computed - -.f =  #31#31 .f = -Type not computed - -[0] → — DATA -[1] → #230 MEM -[2] → #9 DATA -[3] → #21 DATA0123Return  #37#37 Return -Type not computed - -[0] → — CTRL -[1] → #1 MEM -[2] → #9 DATA012MemPhi_2  #230#230 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #10 MEM -[2] → #233 MEM012MemPhi_2  #233#233 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #31 MEM -[2] → #230 MEM012 diff --git a/chapter11/docs/graph5.gv b/chapter11/docs/graph5.gv deleted file mode 100644 index 0baa512f..00000000 --- a/chapter11/docs/graph5.gv +++ /dev/null @@ -1,117 +0,0 @@ -digraph chapter11 { -/* -struct S { int f; } -S v = new S; -int i = arg; -while (arg > 0) { - int j = i/3; - if (arg == 5) - v.f = j; - arg = arg - 1; -} -return v; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$memarg
-
> - ]; - MemMerge [ shape=box label="MemMerge" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - new9 [ label="new S" ]; - Store10 [ label=".f =" ]; - Loop11 [ shape=box style=filled fillcolor=yellow label="Loop" ]; - Phi_arg13 [ style=filled fillcolor=lightyellow label="φ_arg" ]; - LT14 [ label="<" ]; - If16 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Div21 [ label="//" ]; - Con_22 [ label="#3" ]; - EQ23 [ label="==" ]; - Con_24 [ label="#5" ]; - If25 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Phi_230 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Store31 [ label=".f =" ]; - Region32 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_233 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Sub35 [ label="-" ]; - Con_36 [ label="#1" ]; - Return37 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Loop11;Phi_230;Phi_arg13;} - { rank=same; Region32;Phi_233;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return37[taillabel=0 color=red]; - new9 -> Start2:p0[taillabel=0 color=green]; - Store10 -> Start2:p0[taillabel=0 color=red]; - Store10 -> Start2:p1[taillabel=1 color=blue]; - Store10 -> new9[taillabel=2]; - Store10 -> Con_4[taillabel=3]; - Loop11 -> Start2:p0[taillabel=1 color=red]; - Loop11 -> Region32[taillabel=2 color=red constraint=false]; - Phi_arg13 -> Loop11 [style=dotted taillabel=0]; - Phi_arg13 -> Start2:p2[taillabel=1]; - Phi_arg13 -> Sub35[taillabel=2 constraint=false]; - LT14 -> Loop11[taillabel=0 color=red]; - LT14 -> Con_4[taillabel=1]; - LT14 -> Phi_arg13[taillabel=2]; - If16 -> Loop11[taillabel=0 color=red]; - If16 -> LT14[taillabel=1]; - Div21 -> Start2[taillabel=0 color=red]; - Div21 -> Start2:p2[taillabel=1]; - Div21 -> Con_22[taillabel=2]; - EQ23 -> Loop11[taillabel=0 color=red]; - EQ23 -> Phi_arg13[taillabel=1]; - EQ23 -> Con_24[taillabel=2]; - If25 -> If16:p0[taillabel=0 color=red]; - If25 -> EQ23[taillabel=1]; - Phi_230 -> Loop11 [style=dotted taillabel=0]; - Phi_230 -> Store10[taillabel=1 color=blue]; - Phi_230 -> Phi_233[taillabel=2 color=blue constraint=false]; - Store31 -> Loop11[taillabel=0 color=red]; - Store31 -> Phi_230[taillabel=1 color=blue]; - Store31 -> new9[taillabel=2]; - Store31 -> Div21[taillabel=3]; - Region32 -> If25:p0[taillabel=1 color=red]; - Region32 -> If25:p1[taillabel=2 color=red]; - Phi_233 -> Region32 [style=dotted taillabel=0]; - Phi_233 -> Store31[taillabel=1 color=blue]; - Phi_233 -> Phi_230[taillabel=2 color=blue constraint=false]; - Sub35 -> Loop11[taillabel=0 color=red]; - Sub35 -> Phi_arg13[taillabel=1]; - Sub35 -> Con_36[taillabel=2]; - Return37 -> If16:p1[taillabel=0 color=red]; - Return37 -> new9[taillabel=2]; - Return37 -> MemMerge[taillabel=1 color=blue]; - MemMerge -> Start2:p1[taillabel=1 color=blue]; - MemMerge -> Phi_230[taillabel=2 color=blue]; - MemMerge -> Loop11[taillabel=0 color=green]; -} diff --git a/chapter11/docs/graph5.json b/chapter11/docs/graph5.json deleted file mode 100644 index 659384e0..00000000 --- a/chapter11/docs/graph5.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph5.svg", - "step": 1, - "roots": [37], - "scope": 0, - "nodes": [ - {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"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": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, - {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "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": 31, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "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": 0, "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": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} - ], - "groups": [ - ] -} diff --git a/chapter11/docs/graph5.svg b/chapter11/docs/graph5.svg deleted file mode 100644 index c120550f..00000000 --- a/chapter11/docs/graph5.svg +++ /dev/null @@ -1,120 +0,0 @@ -#1[1] → #6 · MEM#1[2] → #230 · MEM#10[1] → #6 · MEM#10[2] → #9 · DATA#10[3] → #4 · DATA#21[1] → #7 · DATA#21[2] → #22 · DATA#31[1] → #230 · MEM#31[2] → #9 · DATA#31[3] → #21 · DATA#37[1] → #1 · MEM#37[2] → #9 · DATA#230[1] → #10 · MEM#230[2] → #233 · MEM#233[1] → #31 · MEM#233[2] → #230 · MEMMemMerge  #1#1 MemMerge -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #230 MEM012Start  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -$mem  #6/1#6 $mem -Projection 1 of #2 -Type not computed - -[0] → #2 MEMarg  #7/2#7 arg -Projection 2 of #2 -Type not computed - -[0] → #2 DATAnew S  #9#9 new S -Type not computed - -[0] → — CTRL0.f =  #10#10 .f = -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #9 DATA -[3] → #4 DATA0123//  #21#21 // -Type not computed - -[0] → — CTRL -[1] → #7 DATA -[2] → #22 DATA012#3  #22#22 #3 -Type not computed - -.f =  #31#31 .f = -Type not computed - -[0] → — CTRL -[1] → #230 MEM -[2] → #9 DATA -[3] → #21 DATA0123Return  #37#37 Return -Type not computed - -[0] → — CTRL -[1] → #1 MEM -[2] → #9 DATA012MemPhi_2  #230#230 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #10 MEM -[2] → #233 MEM012MemPhi_2  #233#233 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #31 MEM -[2] → #230 MEM012 diff --git a/chapter11/docs/graph6.gv b/chapter11/docs/graph6.gv deleted file mode 100644 index ff97eebc..00000000 --- a/chapter11/docs/graph6.gv +++ /dev/null @@ -1,117 +0,0 @@ -digraph chapter11 { -/* -struct S { int f; } -S v = new S; -int i = arg; -while (arg > 0) { - int j = i/3; - if (arg == 5) - v.f = j; - arg = arg - 1; -} -return v; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$memarg
-
> - ]; - MemMerge [ shape=box label="MemMerge" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - new9 [ label="new S" ]; - Store10 [ label=".f =" ]; - Loop11 [ shape=box style=filled fillcolor=yellow label="Loop" ]; - Phi_arg13 [ style=filled fillcolor=lightyellow label="φ_arg" ]; - LT14 [ label="<" ]; - If16 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Div21 [ label="//" ]; - Con_22 [ label="#3" ]; - EQ23 [ label="==" ]; - Con_24 [ label="#5" ]; - If25 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Phi_230 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Store31 [ label=".f =" ]; - Region32 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_233 [ style=filled fillcolor=lightyellow label="MemPhi_2" ]; - Sub35 [ label="-" ]; - Con_36 [ label="#1" ]; - Return37 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Loop11;Phi_230;Phi_arg13;} - { rank=same; Region32;Phi_233;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return37[taillabel=0 color=red]; - new9 -> Start2:p0[taillabel=0 color=green]; - Store10 -> Start2:p0[taillabel=0 color=red]; - Store10 -> Start2:p1[taillabel=1 color=blue]; - Store10 -> new9[taillabel=2]; - Store10 -> Con_4[taillabel=3]; - Loop11 -> Start2:p0[taillabel=1 color=red]; - Loop11 -> Region32[taillabel=2 color=red constraint=false]; - Phi_arg13 -> Loop11 [style=dotted taillabel=0]; - Phi_arg13 -> Start2:p2[taillabel=1]; - Phi_arg13 -> Sub35[taillabel=2 constraint=false]; - LT14 -> Loop11[taillabel=0 color=red]; - LT14 -> Con_4[taillabel=1]; - LT14 -> Phi_arg13[taillabel=2]; - If16 -> Loop11[taillabel=0 color=red]; - If16 -> LT14[taillabel=1]; - Div21 -> Start2:p0[taillabel=0 color=red]; - Div21 -> Start2:p2[taillabel=1]; - Div21 -> Con_22[taillabel=2]; - EQ23 -> If16:p0[taillabel=0 color=red]; - EQ23 -> Phi_arg13[taillabel=1]; - EQ23 -> Con_24[taillabel=2]; - If25 -> If16:p0[taillabel=0 color=red]; - If25 -> EQ23[taillabel=1]; - Phi_230 -> Loop11 [style=dotted taillabel=0]; - Phi_230 -> Store10[taillabel=1 color=blue]; - Phi_230 -> Phi_233[taillabel=2 color=blue constraint=false]; - Store31 -> If25:p0[taillabel=0 color=red]; - Store31 -> Phi_230[taillabel=1 color=blue]; - Store31 -> new9[taillabel=2]; - Store31 -> Div21[taillabel=3]; - Region32 -> If25:p0[taillabel=1 color=red]; - Region32 -> If25:p1[taillabel=2 color=red]; - Phi_233 -> Region32 [style=dotted taillabel=0]; - Phi_233 -> Store31[taillabel=1 color=blue]; - Phi_233 -> Phi_230[taillabel=2 color=blue constraint=false]; - Sub35 -> Region32[taillabel=0 color=red]; - Sub35 -> Phi_arg13[taillabel=1]; - Sub35 -> Con_36[taillabel=2]; - Return37 -> If16:p1[taillabel=0 color=red]; - Return37 -> new9[taillabel=2]; - Return37 -> MemMerge[taillabel=1 color=blue]; - MemMerge -> Start2:p1[taillabel=1 color=blue]; - MemMerge -> Phi_230[taillabel=2 color=blue]; - MemMerge -> If16:p1[taillabel=0 color=green]; -} diff --git a/chapter11/docs/graph6.json b/chapter11/docs/graph6.json deleted file mode 100644 index 512c308d..00000000 --- a/chapter11/docs/graph6.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ver": 1, - "comp": "chapter11/docs/graph6.svg", - "step": 1, - "roots": [37], - "scope": 0, - "nodes": [ - {"id": 1, "label": "MemMerge", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 4, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"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": 9, "label": "new S", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}], "proj": null}, - {"id": 10, "label": ".f =", "type": null, "kind": "MEM", "edges": [{"idx": 0, "def": 0, "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": 15, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, - {"id": 21, "label": "//", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "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": 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": 37, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "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": 0, "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": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 31, "role": "MEM", "label": null}, {"idx": 2, "def": 230, "role": "MEM", "label": null}], "proj": null} - ], - "groups": [ - ] -} diff --git a/chapter11/docs/graph6.svg b/chapter11/docs/graph6.svg deleted file mode 100644 index d6dec88f..00000000 --- a/chapter11/docs/graph6.svg +++ /dev/null @@ -1,124 +0,0 @@ -#1[1] → #6 · MEM#1[2] → #230 · MEM#10[1] → #6 · MEM#10[2] → #9 · DATA#10[3] → #4 · DATA#21[1] → #7 · DATA#21[2] → #22 · DATA#31[0] → #15 · CTRL#31[1] → #230 · MEM#31[2] → #9 · DATA#31[3] → #21 · DATA#37[1] → #1 · MEM#37[2] → #9 · DATA#230[1] → #10 · MEM#230[2] → #233 · MEM#233[1] → #31 · MEM#233[2] → #230 · MEMMemMerge  #1#1 MemMerge -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #230 MEM012Start  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -$mem  #6/1#6 $mem -Projection 1 of #2 -Type not computed - -[0] → #2 MEMarg  #7/2#7 arg -Projection 2 of #2 -Type not computed - -[0] → #2 DATAnew S  #9#9 new S -Type not computed - -[0] → — CTRL0.f =  #10#10 .f = -Type not computed - -[0] → — CTRL -[1] → #6 MEM -[2] → #9 DATA -[3] → #4 DATA0123True  #15/0#15 True -Projection 0 of #0 -Type not computed - -//  #21#21 // -Type not computed - -[0] → — CTRL -[1] → #7 DATA -[2] → #22 DATA012#3  #22#22 #3 -Type not computed - -.f =  #31#31 .f = -Type not computed - -[0] → #15 CTRL -[1] → #230 MEM -[2] → #9 DATA -[3] → #21 DATA0123Return  #37#37 Return -Type not computed - -[0] → — CTRL -[1] → #1 MEM -[2] → #9 DATA012MemPhi_2  #230#230 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #10 MEM -[2] → #233 MEM012MemPhi_2  #233#233 MemPhi_2 -Type not computed - -[0] → — ASSOC -[1] → #31 MEM -[2] → #230 MEM012 diff --git a/chapter11/docs/graph7.gv b/chapter11/docs/graph7.gv deleted file mode 100644 index 18be364b..00000000 --- a/chapter11/docs/graph7.gv +++ /dev/null @@ -1,23 +0,0 @@ -digraph chapter11 { - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl
-
> - ]; - Con_4 [ label="#0" ]; - Loop8 [ shape=box style=filled fillcolor=yellow label="Loop" ]; - { rank=same; Loop8;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Loop8 -> Start2:p0[taillabel=1 color=red]; - Loop8 -> Loop8[taillabel=2 color=red constraint=false]; -} diff --git a/chapter11/docs/graph7.json b/chapter11/docs/graph7.json deleted file mode 100644 index c1c86b07..00000000 --- a/chapter11/docs/graph7.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "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 deleted file mode 100644 index 15d886dc..00000000 --- a/chapter11/docs/graph7.svg +++ /dev/null @@ -1,78 +0,0 @@ -#8[1] → #1 · CTRL#8[2] → #8 · CTRL$ctrl  #1/0#1 $ctrl -Projection 0 of #2 -Type not computed - -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -#0  #4#4 #0 -Type not computed - -Loop  #8#8 Loop -Type not computed - -[0] → — DATA -[1] → #1 CTRL -[2] → #8 CTRL012Loop  #8Loop · 1 nodes−Fold region diff --git a/chapter11/docs/graph8.gv b/chapter11/docs/graph8.gv deleted file mode 100644 index 431cef46..00000000 --- a/chapter11/docs/graph8.gv +++ /dev/null @@ -1,45 +0,0 @@ -digraph chapter11 { -/* -while (1) {} -return 0; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Never18 [ shape=plaintext label=< - - - -
Never
- - -
TrueFalse
-
> - ]; - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl
-
> - ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - Con_4 [ label="#0" ]; - Return21 [ shape=box style=filled fillcolor=yellow label="Return" ]; - Loop8 [ shape=box style=filled fillcolor=yellow label="Loop" ]; - { rank=same; Loop8;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Never18 -> Loop8[taillabel=0 color=red]; - Never18 -> Con_4[taillabel=1]; - Stop3 -> Return21[taillabel=0 color=red]; - Return21 -> Never18:p0[taillabel=0 color=red]; - Return21 -> Con_4[taillabel=2]; - Loop8 -> Start2:p0[taillabel=1 color=red]; - Loop8 -> Never18:p1[taillabel=2 color=red constraint=false]; -} diff --git a/chapter11/docs/graph8.json b/chapter11/docs/graph8.json deleted file mode 100644 index ab2ef65c..00000000 --- a/chapter11/docs/graph8.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "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 deleted file mode 100644 index d96a9a7d..00000000 --- a/chapter11/docs/graph8.svg +++ /dev/null @@ -1,98 +0,0 @@ -#3[0] → #21 · CTRL#8[1] → #6 · CTRL#8[2] → #5 · CTRL#18[0] → #8 · CTRL#18[1] → #4 · DATA#21[0] → #1 · CTRL#21[2] → #4 · DATATrue  #1/0#1 True -Projection 0 of #18 -Type not computed - -[0] → #18 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #21 CTRL0#0  #4#4 #0 -Type not computed - -False  #5/1#5 False -Projection 1 of #18 -Type not computed - -[0] → #18 CTRL$ctrl  #6/0#6 $ctrl -Projection 0 of #2 -Type not computed - -[0] → #2 CTRLLoop  #8#8 Loop -Type not computed - -[0] → — DATA -[1] → #6 CTRL -[2] → #5 CTRL012Never  #18#18 Never -Type not computed - -[0] → #8 CTRL -[1] → #4 DATA01Return  #21#21 Return -Type not computed - -[0] → #1 CTRL -[1] → — DATA -[2] → #4 DATA012Loop  #8Loop · 4 nodes−Fold region diff --git a/chapter11/docs/lattice.gv b/chapter11/docs/lattice.gv new file mode 100644 index 00000000..93d99dd8 --- /dev/null +++ b/chapter11/docs/lattice.gv @@ -0,0 +1,133 @@ +digraph Lattice { + 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_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: 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]; + 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"]; + // Each black element stands for a recursively nested type lattice. + TUPLE1 [shape=plain, label=< + + + +
tuple
type
+ >]; + TUPLE2 [shape=plain, label=< + + + + +
tuple
type
type
+ >]; + TUPLEN [shape=plain, label=< + + + + + +
tuple
type
…
type
+ >]; + {rank=same; TUPLE1; TUPLE2; TUPLEN;} + TUPLE1 -> TUPLE2 -> TUPLEN [style=invis]; + TUPLE_TOP -> {TUPLE1 TUPLE2 TUPLEN}; + {TUPLE1 TUPLE2 TUPLEN} -> TUPLE_BOT; + } + + TOP -> {XCTRL INT_TOP PTR_TOP STRUCT_TOP MEM_TOP TUPLE_TOP}; + {CTRL INT_BOT PTR_BOT STRUCT_BOT MEM_BOT TUPLE_BOT} -> BOT; + {rank=same; XCTRL; INT_TOP; PTR_TOP; STRUCT_TOP; MEM_TOP; TUPLE_TOP;} + {rank=same; CTRL; INT_BOT; PTR_BOT; STRUCT_BOT; MEM_BOT; TUPLE_BOT;} + XCTRL -> INT_TOP -> PTR_TOP -> STRUCT_TOP -> MEM_TOP -> TUPLE_TOP [style=invis]; +} diff --git a/chapter11/docs/lattice.svg b/chapter11/docs/lattice.svg new file mode 100644 index 00000000..8d2e2875 --- /dev/null +++ b/chapter11/docs/lattice.svg @@ -0,0 +1,644 @@ + + + + + + +Lattice + + +cluster_control + +Control + + +cluster_integer + +Integer + + +cluster_pointer + +Pointer = nullability × struct type + + +cluster_struct + +Struct +named collection of named scalar types + + +cluster_memory + +Memory +precise alias slices + + +cluster_tuple + +Tuple +collection of types + + + +TOP + +⊤ + + + +XCTRL + +⊤:ctrl + + + +TOP->XCTRL + + + + + +INT_TOP + +⊤:int + + + +TOP->INT_TOP + + + + + +PTR_TOP + +⊤:ptr +[*⊤:struct] + + + +TOP->PTR_TOP + + + + + +STRUCT_TOP + +⊤:struct +[struct top] + + + +TOP->STRUCT_TOP + + + + + +MEM_TOP + +⊤:mem + + + +TOP->MEM_TOP + + + + + +TUPLE_TOP + +⊤:tuple + + + +TOP->TUPLE_TOP + + + + + +BOT + +⊥ + + + +CTRL + +⊥:ctrl + + + +XCTRL->CTRL + + + + + + +CTRL->BOT + + + + + +INT_NEG + +… −2, −1 + + + +INT_TOP->INT_NEG + + + + + +INT_ZERO + +0 + + + +INT_TOP->INT_ZERO + + + + + +INT_POS + +1, 2, … + + + +INT_TOP->INT_POS + + + + + + +INT_BOT + +⊥:int + + + +INT_BOT->BOT + + + + + +INT_NEG->INT_BOT + + + + + + +INT_ZERO->INT_BOT + + + + + + +INT_POS->INT_BOT + + + + + +PTR_NULL + +null + + + +PTR_TOP->PTR_NULL + + + + + +PTR_PERSON + +*Person + + + +PTR_TOP->PTR_PERSON + + + + + +PTR_S1 + +*s1 + + + +PTR_TOP->PTR_S1 + + + + + +PTR_MORE + +*s2, … + + + +PTR_TOP->PTR_MORE + + + + + + +PTR_BOT + +⊥:ptr +[*⊥:struct?] + + + +PTR_BOT->BOT + + + + + +PTR_PERSON_NIL + +*Person? + + + +PTR_NULL->PTR_PERSON_NIL + + + + + +PTR_S1_NIL + +*s1? + + + +PTR_NULL->PTR_S1_NIL + + + + + +PTR_MORE_NIL + +*s2?, … + + + +PTR_NULL->PTR_MORE_NIL + + + + + +PTR_ANY + +*⊥:struct +[ptr any struct] + + + +PTR_ANY->PTR_BOT + + + + + + +PTR_PERSON->PTR_ANY + + + + + + +PTR_PERSON->PTR_PERSON_NIL + + + + + +PTR_S1->PTR_ANY + + + + + + +PTR_S1->PTR_S1_NIL + + + + + + +PTR_MORE->PTR_ANY + + + + + +PTR_MORE->PTR_MORE_NIL + + + + + +PTR_PERSON_NIL->PTR_BOT + + + + + + +PTR_S1_NIL->PTR_BOT + + + + + + +PTR_MORE_NIL->PTR_BOT + + + + + +STRUCT_PERSON + +Person +age: int + + + +STRUCT_TOP->STRUCT_PERSON + + + + + +STRUCT_S1 + +s1 +x: int + + + +STRUCT_TOP->STRUCT_S1 + + + + + +STRUCT_S2 + +s2 +x: int, y: int + + + +STRUCT_TOP->STRUCT_S2 + + + + + +STRUCT_MORE + +… + + + +STRUCT_TOP->STRUCT_MORE + + + + + + +STRUCT_BOT + +⊥:struct +[struct bottom] + + + +STRUCT_BOT->BOT + + + + + +STRUCT_PERSON->STRUCT_BOT + + + + + + +STRUCT_S1->STRUCT_BOT + + + + + + +STRUCT_S2->STRUCT_BOT + + + + + + +STRUCT_MORE->STRUCT_BOT + + + + + +MEM_ALIAS2 + +MEM#2 + + + +MEM_TOP->MEM_ALIAS2 + + + + + +MEM_ALIAS3 + +MEM#3 + + + +MEM_TOP->MEM_ALIAS3 + + + + + +MEM_MORE + +… + + + +MEM_TOP->MEM_MORE + + + + + + +MEM_BOT + +⊥:mem + + + +MEM_BOT->BOT + + + + + +MEM_ALIAS2->MEM_BOT + + + + + + +MEM_ALIAS3->MEM_BOT + + + + + + +MEM_MORE->MEM_BOT + + + + + +TUPLE1 + + + +tuple + + +type + + + +TUPLE_TOP->TUPLE1 + + + + + +TUPLE2 + + + +tuple + + +type + + +type + + + +TUPLE_TOP->TUPLE2 + + + + + +TUPLEN + + + +tuple + + +type + + +… + + +type + + + +TUPLE_TOP->TUPLEN + + + + + +TUPLE_BOT + +⊥:tuple + + + +TUPLE_BOT->BOT + + + + + +TUPLE1->TUPLE_BOT + + + + + + +TUPLE2->TUPLE_BOT + + + + + + +TUPLEN->TUPLE_BOT + + + + + -- cgit v1.2.3