From 6347fa6dc2ee8d3060f2f0db21f03f11d374b0bc Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Tue, 29 Sep 2026 12:34:58 -0700 Subject: Squashed commit of the following: commit 3ba6686fc991998a0a420709dfb0012bbddf77ab Author: Cliff Click Date: Tue Sep 29 12:21:46 2026 -0700 Backport lazy memory splits to ch10, split into ch10a and b commit fa7d56f72455828826d0ab7e1c142ca814e6e2aa Author: Cliff Click Date: Tue Sep 29 10:10:53 2026 -0700 Reverse edges commit e1bba17ff54400a34ede0eaacad863420d021119 Author: Cliff Click Date: Tue Sep 29 09:44:41 2026 -0700 Split ch10 Basic memory introduction in 10a, then precise aliases in 10b. --- chapter10/docs/10-grammar.md | 125 ---------- chapter10/docs/Makefile | 12 - chapter10/docs/example1.gv | 78 ------- chapter10/docs/example1.svg | 294 ------------------------ chapter10/docs/example2a.gv | 65 ------ chapter10/docs/example2a.svg | 249 -------------------- chapter10/docs/example2b.gv | 56 ----- chapter10/docs/example2b.svg | 189 ---------------- chapter10/docs/example2c.gv | 53 ----- chapter10/docs/example2c.svg | 168 -------------- chapter10/docs/lattice.drawio | 379 ------------------------------- chapter10/docs/lattice.gv | 161 ------------- chapter10/docs/lattice.svg | 516 ------------------------------------------ 13 files changed, 2345 deletions(-) delete mode 100644 chapter10/docs/10-grammar.md delete mode 100644 chapter10/docs/Makefile delete mode 100644 chapter10/docs/example1.gv delete mode 100644 chapter10/docs/example1.svg delete mode 100644 chapter10/docs/example2a.gv delete mode 100644 chapter10/docs/example2a.svg delete mode 100644 chapter10/docs/example2b.gv delete mode 100644 chapter10/docs/example2b.svg delete mode 100644 chapter10/docs/example2c.gv delete mode 100644 chapter10/docs/example2c.svg delete mode 100644 chapter10/docs/lattice.drawio delete mode 100644 chapter10/docs/lattice.gv delete mode 100644 chapter10/docs/lattice.svg (limited to 'chapter10/docs') diff --git a/chapter10/docs/10-grammar.md b/chapter10/docs/10-grammar.md deleted file mode 100644 index b76531d5..00000000 --- a/chapter10/docs/10-grammar.md +++ /dev/null @@ -1,125 +0,0 @@ -# Grammar for Chapter 10 - -```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/chapter10/docs/Makefile b/chapter10/docs/Makefile deleted file mode 100644 index 12659b8f..00000000 --- a/chapter10/docs/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) diff --git a/chapter10/docs/example1.gv b/chapter10/docs/example1.gv deleted file mode 100644 index cbb12cb5..00000000 --- a/chapter10/docs/example1.gv +++ /dev/null @@ -1,78 +0,0 @@ -digraph chapter10 { -/* -struct Vector2D { int x; int y; } -Vector2D v = new Vector2D; -v.x = 1; -if (arg) - v.y = 2; -else - v.y = 3; -return v; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrlarg$2$3
-
> - ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - new8 [ label="new Vector2D" ]; - Con_9 [ label="#0" ]; - Store11 [ label=".y =" ]; - Con_12 [ label="#1" ]; - Store13 [ label=".x =" ]; - If14 [ shape=plaintext label=< - - - -
If
- - -
TrueFalse
-
> - ]; - Con_18 [ label="#2" ]; - Store19 [ label=".y =" ]; - Con_22 [ label="#3" ]; - Store23 [ label=".y =" ]; - Region24 [ shape=box style=filled fillcolor=yellow label="Region" ]; - Phi_326 [ style=filled fillcolor=lightyellow label="φ_$3" ]; - Return27 [ shape=box style=filled fillcolor=yellow label="Return" ]; - { rank=same; Region24;Phi_326;} - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return27[taillabel=0 color=red]; - new8 -> Start2:p0[taillabel=0 color=green]; - Store11 -> Start2:p3[taillabel=1 color=blue]; - Store11 -> new8[taillabel=2]; - Store11 -> Con_9[taillabel=3]; - Store13 -> Start2:p2[taillabel=1 color=blue]; - Store13 -> new8[taillabel=2]; - Store13 -> Con_12[taillabel=3]; - If14 -> Start2:p0[taillabel=0 color=red]; - If14 -> Start2:p1[taillabel=1]; - Store19 -> Store11[taillabel=1 color=blue]; - Store19 -> new8[taillabel=2]; - Store19 -> Con_18[taillabel=3]; - Store23 -> Store11[taillabel=1 color=blue]; - Store23 -> new8[taillabel=2]; - Store23 -> Con_22[taillabel=3]; - Region24 -> If14:p0[taillabel=1 color=red]; - Region24 -> If14:p1[taillabel=2 color=red]; - Phi_326 -> Region24 [style=dotted taillabel=0]; - Phi_326 -> Store19[taillabel=1 color=blue]; - Phi_326 -> Store23[taillabel=2 color=blue constraint=false]; - Return27 -> Region24[taillabel=0 color=red]; - Return27 -> new8[taillabel=1]; - Return27 -> Store13[taillabel=2 color=blue]; - Return27 -> Phi_326[taillabel=3 color=blue]; -} diff --git a/chapter10/docs/example1.svg b/chapter10/docs/example1.svg deleted file mode 100644 index 6f493e7e..00000000 --- a/chapter10/docs/example1.svg +++ /dev/null @@ -1,294 +0,0 @@ - - - - - - -chapter10 - - -cluster_Nodes - - - - -Start2 - - -Start - - - -$ctrl - -arg - -$2 - -$3 - - - -Stop3 - -Stop - - - -Return27 - -Return - - - -Stop3->Return27 - - -0 - - - -new8 - -new Vector2D - - - -new8->Start2:p0 - - -0 - - - -Con_9 - -#0 - - - -Store11 - -.y = - - - -Store11->Start2:p3 - - -1 - - - -Store11->new8 - - -2 - - - -Store11->Con_9 - - -3 - - - -Con_12 - -#1 - - - -Store13 - -.x = - - - -Store13->Start2:p2 - - -1 - - - -Store13->new8 - - -2 - - - -Store13->Con_12 - - -3 - - - -If14 - - -If - - - -True - - -False - - - -If14->Start2:p0 - - -0 - - - -Con_18 - -#2 - - - -Store19 - -.y = - - - -Store19->new8 - - - -2 - - - -Store19->Store11 - - -1 - - - -Store19->Con_18 - - -3 - - - -Con_22 - -#3 - - - -Store23 - -.y = - - - -Store23->new8 - -2 - - - -Store23->Store11 - - -1 - - - -Store23->Con_22 - - -3 - - - -Region24 - -Region - - - -Region24->If14:p0 - - -1 - - - -Region24->If14:p1 - - -2 - - - -Phi_326 - -φ_$3 - - - -Phi_326->Store19 - - -1 - - - -Phi_326->Store23 - - -2 - - - -Phi_326->Region24 - - -0 - - - -Return27->new8 - - -1 - - - -Return27->Store13 - - -2 - - - -Return27->Region24 - - -0 - - - -Return27->Phi_326 - - -3 - - - diff --git a/chapter10/docs/example2a.gv b/chapter10/docs/example2a.gv deleted file mode 100644 index 23f31bf8..00000000 --- a/chapter10/docs/example2a.gv +++ /dev/null @@ -1,65 +0,0 @@ -digraph chapter10 { -/* -struct Bar { - int a; - int b; -} -struct Foo { - int x; -} -Foo? foo = null; -Bar bar = new Bar; -bar.a = 1; -bar.a = 2; -return bar.a; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$2$3$4
-
> - ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - new10 [ label="new Bar" ]; - Con_11 [ label="#0" ]; - Store12 [ label=".a =" ]; - Store13 [ label=".b =" ]; - Con_14 [ label="#1" ]; - Store15 [ label=".a =" ]; - Con_16 [ label="#2" ]; - Store17 [ label=".a =" ]; - Load18 [ label=".a" ]; - Return19 [ shape=box style=filled fillcolor=yellow label="Return" ]; - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return19[taillabel=0 color=red]; - new10 -> Start2:p0[taillabel=0 color=green]; - Store12 -> Start2:p2[taillabel=1 color=blue]; - Store12 -> new10[taillabel=2]; - Store12 -> Con_11[taillabel=3]; - Store13 -> Start2:p3[taillabel=1 color=blue]; - Store13 -> new10[taillabel=2]; - Store13 -> Con_11[taillabel=3]; - Store15 -> Store12[taillabel=1 color=blue]; - Store15 -> new10[taillabel=2]; - Store15 -> Con_14[taillabel=3]; - Store17 -> Store15[taillabel=1 color=blue]; - Store17 -> new10[taillabel=2]; - Store17 -> Con_16[taillabel=3]; - Load18 -> Store17[taillabel=1 color=blue]; - Load18 -> new10[taillabel=2]; - Return19 -> Start2:p0[taillabel=0 color=red]; - Return19 -> Load18[taillabel=1]; - Return19 -> Store17[taillabel=2 color=blue]; - Return19 -> Store13[taillabel=3 color=blue]; - Return19 -> Start2:p4[taillabel=4 color=blue]; -} diff --git a/chapter10/docs/example2a.svg b/chapter10/docs/example2a.svg deleted file mode 100644 index 9f069ad4..00000000 --- a/chapter10/docs/example2a.svg +++ /dev/null @@ -1,249 +0,0 @@ - - - - - - -chapter10 - - -cluster_Nodes - - - - -Start2 - - -Start - - - -$ctrl - -$2 - -$3 - -$4 - - - -Stop3 - -Stop - - - -Return19 - -Return - - - -Stop3->Return19 - - -0 - - - -new10 - -new Bar - - - -new10->Start2:p0 - - -0 - - - -Con_11 - -#0 - - - -Store12 - -.a = - - - -Store12->Start2:p2 - - -1 - - - -Store12->new10 - - -2 - - - -Store12->Con_11 - - -3 - - - -Store13 - -.b = - - - -Store13->Start2:p3 - - -1 - - - -Store13->new10 - - -2 - - - -Store13->Con_11 - - -3 - - - -Con_14 - -#1 - - - -Store15 - -.a = - - - -Store15->new10 - - -2 - - - -Store15->Store12 - - -1 - - - -Store15->Con_14 - - -3 - - - -Con_16 - -#2 - - - -Store17 - -.a = - - - -Store17->new10 - -2 - - - -Store17->Store15 - - -1 - - - -Store17->Con_16 - - -3 - - - -Load18 - -.a - - - -Load18->new10 - - - -2 - - - -Load18->Store17 - - -1 - - - -Return19->Start2:p0 - - -0 - - - -Return19->Start2:p4 - - -4 - - - -Return19->Store13 - - - -3 - - - -Return19->Store17 - - - -2 - - - -Return19->Load18 - - -1 - - - diff --git a/chapter10/docs/example2b.gv b/chapter10/docs/example2b.gv deleted file mode 100644 index d732e874..00000000 --- a/chapter10/docs/example2b.gv +++ /dev/null @@ -1,56 +0,0 @@ -digraph chapter10 { -/* -struct Bar { - int a; - int b; -} -struct Foo { - int x; -} -Foo? foo = null; -Bar bar = new Bar; -bar.a = 1; -bar.a = 2; -return bar.a; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$2$3$4
-
> - ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - new10 [ label="new Bar" ]; - Con_11 [ label="#0" ]; - Store13 [ label=".b =" ]; - Con_16 [ label="#2" ]; - Store17 [ label=".a =" ]; - Load18 [ label=".a" ]; - Return19 [ shape=box style=filled fillcolor=yellow label="Return" ]; - } - edge [ fontname=Helvetica, fontsize=8 ]; - Stop3 -> Return19[taillabel=0 color=red]; - new10 -> Start2:p0[taillabel=0 color=green]; - Store13 -> Start2:p3[taillabel=1 color=blue]; - Store13 -> new10[taillabel=2]; - Store13 -> Con_11[taillabel=3]; - Store17 -> Start2:p2[taillabel=1 color=blue]; - Store17 -> new10[taillabel=2]; - Store17 -> Con_16[taillabel=3]; - Load18 -> Store17[taillabel=1 color=blue]; - Load18 -> new10[taillabel=2]; - Return19 -> Start2:p0[taillabel=0 color=red]; - Return19 -> Load18[taillabel=1]; - Return19 -> Store17[taillabel=2 color=blue]; - Return19 -> Store13[taillabel=3 color=blue]; - Return19 -> Start2:p4[taillabel=4 color=blue]; -} diff --git a/chapter10/docs/example2b.svg b/chapter10/docs/example2b.svg deleted file mode 100644 index 1ecf4de7..00000000 --- a/chapter10/docs/example2b.svg +++ /dev/null @@ -1,189 +0,0 @@ - - - - - - -chapter10 - - -cluster_Nodes - - - - -Start2 - - -Start - - - -$ctrl - -$2 - -$3 - -$4 - - - -Stop3 - -Stop - - - -Return19 - -Return - - - -Stop3->Return19 - - -0 - - - -new10 - -new Bar - - - -new10->Start2:p0 - - -0 - - - -Con_11 - -#0 - - - -Store13 - -.b = - - - -Store13->Start2:p3 - - -1 - - - -Store13->new10 - - -2 - - - -Store13->Con_11 - - -3 - - - -Con_16 - -#2 - - - -Store17 - -.a = - - - -Store17->Start2:p2 - - -1 - - - -Store17->new10 - - -2 - - - -Store17->Con_16 - - -3 - - - -Load18 - -.a - - - -Load18->new10 - - -2 - - - -Load18->Store17 - - -1 - - - -Return19->Start2:p0 - - - -0 - - - -Return19->Start2:p4 - - -4 - - - -Return19->Store13 - - - -3 - - - -Return19->Store17 - - -2 - - - -Return19->Load18 - - -1 - - - diff --git a/chapter10/docs/example2c.gv b/chapter10/docs/example2c.gv deleted file mode 100644 index 76db03bb..00000000 --- a/chapter10/docs/example2c.gv +++ /dev/null @@ -1,53 +0,0 @@ -digraph chapter10 { -/* -struct Bar { - int a; - int b; -} -struct Foo { - int x; -} -Foo? foo = null; -Bar bar = new Bar; -bar.a = 1; -bar.a = 2; -return bar.a; - -*/ - rankdir=BT; - concentrate="true"; - compound="true"; - subgraph cluster_Nodes { - Con_16 [ label="#2" ]; - Store17 [ label=".a =" ]; - Start2 [ shape=plaintext label=< - - - -
Start
- - -
$ctrl$2$3$4
-
> - ]; - Return19 [ shape=box style=filled fillcolor=yellow label="Return" ]; - Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; - new10 [ label="new Bar" ]; - Con_11 [ label="#0" ]; - Store13 [ label=".b =" ]; - } - edge [ fontname=Helvetica, fontsize=8 ]; - Store17 -> Start2:p2[taillabel=1 color=blue]; - Store17 -> new10[taillabel=2]; - Store17 -> Con_16[taillabel=3]; - Return19 -> Start2:p0[taillabel=0 color=red]; - Return19 -> Con_16[taillabel=1]; - Return19 -> Store17[taillabel=2 color=blue]; - Return19 -> Store13[taillabel=3 color=blue]; - Return19 -> Start2:p4[taillabel=4 color=blue]; - Stop3 -> Return19[taillabel=0 color=red]; - new10 -> Start2:p0[taillabel=0 color=green]; - Store13 -> Start2:p3[taillabel=1 color=blue]; - Store13 -> new10[taillabel=2]; - Store13 -> Con_11[taillabel=3]; -} diff --git a/chapter10/docs/example2c.svg b/chapter10/docs/example2c.svg deleted file mode 100644 index d70660a2..00000000 --- a/chapter10/docs/example2c.svg +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - -chapter10 - - -cluster_Nodes - - - - -Con_16 - -#2 - - - -Store17 - -.a = - - - -Store17->Con_16 - - -3 - - - -Start2 - - -Start - - - -$ctrl - -$2 - -$3 - -$4 - - - -Store17->Start2:p2 - - -1 - - - -new10 - -new Bar - - - -Store17->new10 - - -2 - - - -Return19 - -Return - - - -Return19->Con_16 - - -1 - - - -Return19->Store17 - - -2 - - - -Return19->Start2:p0 - - - -0 - - - -Return19->Start2:p4 - - -4 - - - -Store13 - -.b = - - - -Return19->Store13 - - -3 - - - -Stop3 - -Stop - - - -Stop3->Return19 - - -0 - - - -new10->Start2:p0 - - -0 - - - -Con_11 - -#0 - - - -Store13->Start2:p3 - - -1 - - - -Store13->new10 - - -2 - - - -Store13->Con_11 - - -3 - - - diff --git a/chapter10/docs/lattice.drawio b/chapter10/docs/lattice.drawio deleted file mode 100644 index cf20e9f3..00000000 --- a/chapter10/docs/lattice.drawio +++ /dev/null @@ -1,379 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/chapter10/docs/lattice.gv b/chapter10/docs/lattice.gv deleted file mode 100644 index 7723e2a2..00000000 --- a/chapter10/docs/lattice.gv +++ /dev/null @@ -1,161 +0,0 @@ -digraph Lattice { - compound = true; - // Define nodes - splines=false; - node [shape=circle, style=filled]; - nodesep=0.6; - - TOP [label=<⊤>, fillcolor=black, fontcolor=white]; - BOT [label=<⊥>, fillcolor=black, fontcolor=white]; - - // ---------------------- - // Control - XCTRL [label=<⊤:ctrl>, fillcolor=yellow, shape=oval]; - CTRL [label=<⊥:ctrl>, fillcolor=yellow, shape=oval]; - - TOP -> XCTRL; - XCTRL -> CTRL; - CTRL -> BOT; - - // ---------------------- - // Integers - INT_TOP [label=<⊤:int>, fillcolor=lightblue, shape=oval]; - INT_BOT [label=<⊥:int>, fillcolor=lightblue, shape=oval]; - - INT_MINDOTS [label="...", fillcolor=lightblue, shape=oval]; - INT_ZERO [label="0" , fillcolor=lightblue]; - INT_MAXDOTS [label="...", fillcolor=lightblue, shape=oval]; - - TOP -> INT_TOP; - INT_TOP -> INT_MINDOTS; - INT_TOP -> INT_ZERO; - INT_TOP -> INT_MAXDOTS; - INT_MINDOTS -> INT_BOT; - INT_ZERO -> INT_BOT; - INT_MAXDOTS -> INT_BOT; - INT_BOT -> BOT; - - INT_MINDOTS -> INT_ZERO -> INT_MAXDOTS [style=invis]; - - // ---------------------- - // Pointers, just a boolean nil/not and a struct - PTR [shape=none, fillcolor=none, label=< - - - -
*ptr
struct
- >]; - PTR0 [shape=none, fillcolor=none, label=< - - - -
*ptr?
struct
- >]; - - TOP -> PTR; - PTR -> PTR0; - PTR0 -> BOT; - - // ---------------------- - // Structs - STRUCT_TOP [label=<⊤:struct>, fillcolor=lightgreen, shape=oval]; - STRUCT_BOT [label=<⊥:struct>, fillcolor=lightgreen, shape=oval]; - - STRUCT_S1 [shape=none, fillcolor=none, label=< - - -
fieldint/ptr
- >]; - STRUCT_S2 [shape=none, fillcolor=none, label=< - - - -
fieldint/ptr
fieldint/ptr
- >]; - STRUCT_SN [shape=none, fillcolor=none, label=< - - - - -
fieldint/ptr
... int/ptr
fieldint/ptr
- >]; - - - TOP -> STRUCT_TOP; - STRUCT_TOP -> STRUCT_S1; - STRUCT_TOP -> STRUCT_S2; - STRUCT_TOP -> STRUCT_SN; - STRUCT_S1 -> STRUCT_BOT; - STRUCT_S2 -> STRUCT_BOT; - STRUCT_SN -> STRUCT_BOT; - STRUCT_BOT -> BOT; - - STRUCT_S1 -> STRUCT_S2 -> STRUCT_SN [style=invis]; - - // ---------------------- - // Memory - MEM_TOP [label=<⊤:mem>, fillcolor=blue, fontcolor=white, shape=oval]; - MEM_BOT [label=<⊥:mem>, fillcolor=blue, fontcolor=white, shape=oval]; - MEM_ALIAS1 [label="#1" , fillcolor=blue, fontcolor=white]; - MEM_ALIASDOTS [label="..." , fillcolor=blue, fontcolor=white, shape=oval]; - MEM_ALIASN [label="#n" , fillcolor=blue, fontcolor=white]; - - TOP -> MEM_TOP; - MEM_TOP -> MEM_ALIAS1; - MEM_TOP -> MEM_ALIASDOTS; - MEM_TOP -> MEM_ALIASN; - MEM_ALIAS1 -> MEM_BOT; - MEM_ALIASDOTS -> MEM_BOT; - MEM_ALIASN -> MEM_BOT; - MEM_BOT -> BOT; - - MEM_ALIAS1 -> MEM_ALIASDOTS -> MEM_ALIASN [style=invis]; - - // ---------------------- - // Tuples - - TUPLE_TOP [label=<⊤:tuple>, fillcolor=pink, shape=oval]; - TUPLE_BOT [label=<⊥:tuple>, fillcolor=pink, shape=oval]; - - TUPLE1 [shape=none, fillcolor=none, label=< - - - -
Tuple
type
- >]; - TUPLE2 [shape=none, fillcolor=none, label=< - - - - -
Tuple
type
type
- >]; - TUPLEN [shape=none, fillcolor=none, label=< - - - - - -
Tuple
type
...
type
- >]; - - - TOP -> TUPLE_TOP; - TUPLE_TOP -> TUPLE1; - TUPLE_TOP -> TUPLE2; - TUPLE_TOP -> TUPLEN; - TUPLE1 -> TUPLE_BOT; - TUPLE2 -> TUPLE_BOT; - TUPLEN -> TUPLE_BOT; - TUPLE_BOT -> BOT; - - // ---------------------- - // Additional customization - {rank=same; TOP;} - {rank=same; INT_TOP; XCTRL; STRUCT_TOP; MEM_TOP; TUPLE_TOP} - {rank=same; INT_MINDOTS; INT_ZERO; INT_MAXDOTS; - STRUCT_S1; STRUCT_S2; STRUCT_SN; - MEM_ALIAS1; MEM_ALIASDOTS; MEM_ALIASN;} - {rank=same; INT_BOT; CTRL; STRUCT_BOT; MEM_BOT; TUPLE_BOT} - {rank=same; BOT;} -} diff --git a/chapter10/docs/lattice.svg b/chapter10/docs/lattice.svg deleted file mode 100644 index 9eb36bbe..00000000 --- a/chapter10/docs/lattice.svg +++ /dev/null @@ -1,516 +0,0 @@ - - - - - - -Lattice - - - -TOP - -⊤ - - - -XCTRL - -⊤ -:ctrl - - - -TOP->XCTRL - - - - - -INT_TOP - -⊤ -:int - - - -TOP->INT_TOP - - - - - -PTR - - - -*ptr - - -struct - - - -TOP->PTR - - - - - -STRUCT_TOP - -⊤ -:struct - - - -TOP->STRUCT_TOP - - - - - -MEM_TOP - -⊤ -:mem - - - -TOP->MEM_TOP - - - - - -TUPLE_TOP - -⊤ -:tuple - - - -TOP->TUPLE_TOP - - - - - -BOT - -⊥ - - - -CTRL - -⊥ -:ctrl - - - -XCTRL->CTRL - - - - - -CTRL->BOT - - - - - -INT_MINDOTS - -... - - - -INT_TOP->INT_MINDOTS - - - - - -INT_ZERO - -0 - - - -INT_TOP->INT_ZERO - - - - - -INT_MAXDOTS - -... - - - -INT_TOP->INT_MAXDOTS - - - - - -INT_BOT - -⊥ -:int - - - -INT_BOT->BOT - - - - - -INT_MINDOTS->INT_BOT - - - - - - -INT_ZERO->INT_BOT - - - - - - -INT_MAXDOTS->INT_BOT - - - - - -PTR0 - - - -*ptr? - - -struct - - - -PTR->PTR0 - - - - - -PTR0->BOT - - - - - -STRUCT_S1 - - - -field - - - - - - - - -int/ptr - - - -STRUCT_TOP->STRUCT_S1 - - - - - -STRUCT_S2 - - - -field - - - - - - - - -int/ptr - - -field - - - - - - - - -int/ptr - - - -STRUCT_TOP->STRUCT_S2 - - - - - -STRUCT_SN - - - -field - - - - - - - - -int/ptr - - -...   - - - - - - - - -int/ptr - - -field - - - - - - - - -int/ptr - - - -STRUCT_TOP->STRUCT_SN - - - - - -STRUCT_BOT - -⊥ -:struct - - - -STRUCT_BOT->BOT - - - - - -STRUCT_S1->STRUCT_BOT - - - - - - -STRUCT_S2->STRUCT_BOT - - - - - - -STRUCT_SN->STRUCT_BOT - - - - - -MEM_ALIAS1 - -#1 - - - -MEM_TOP->MEM_ALIAS1 - - - - - -MEM_ALIASDOTS - -... - - - -MEM_TOP->MEM_ALIASDOTS - - - - - -MEM_ALIASN - -#n - - - -MEM_TOP->MEM_ALIASN - - - - - -MEM_BOT - -⊥ -:mem - - - -MEM_BOT->BOT - - - - - -MEM_ALIAS1->MEM_BOT - - - - - - -MEM_ALIASDOTS->MEM_BOT - - - - - - -MEM_ALIASN->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