From 41ae6269689e2b3cde9f7ac4227923d4085dceda Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 2 Oct 2026 16:21:02 -0700 Subject: More better layout ch10a,b,11 --- chapter12/docs/lattice.gv | 25 +++- chapter12/docs/lattice.svg | 322 ++++++++++++++++++++++++--------------------- 2 files changed, 195 insertions(+), 152 deletions(-) (limited to 'chapter12') diff --git a/chapter12/docs/lattice.gv b/chapter12/docs/lattice.gv index f3b5051c..e8631cd5 100644 --- a/chapter12/docs/lattice.gv +++ b/chapter12/docs/lattice.gv @@ -118,9 +118,28 @@ digraph Lattice { node [fillcolor="#ffc0cb"]; TUPLE_TOP [label="⊤:tuple"]; TUPLE_BOT [label="⊥:tuple"]; - TUPLE1 [label="(type)", shape=box]; - TUPLE2 [label="(type, type)", shape=box]; - TUPLEN [label="(type, …)", shape=box]; + // 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}; diff --git a/chapter12/docs/lattice.svg b/chapter12/docs/lattice.svg index bc64abb6..41804d92 100644 --- a/chapter12/docs/lattice.svg +++ b/chapter12/docs/lattice.svg @@ -4,141 +4,141 @@ - - + + Lattice - + cluster_control - -Control + +Control cluster_integer - -Integer + +Integer cluster_float - -Float + +Float cluster_pointer - -Pointer = nullability × struct type + +Pointer = nullability × struct type cluster_struct - -Struct -named collection of named scalar types + +Struct +named collection of named scalar types cluster_memory - -Memory -precise alias slices + +Memory +precise alias slices cluster_tuple - -Tuple -collection of types + +Tuple +collection of types TOP - -⊤ + +⊤ XCTRL - -⊤:ctrl + +⊤:ctrl TOP->XCTRL - - + + INT_TOP - -⊤:int + +⊤:int TOP->INT_TOP - - + + FLT_TOP - -⊤ -:flt + +⊤ +:flt TOP->FLT_TOP - - + + PTR_TOP - -⊤:ptr -[*⊤:struct] + +⊤:ptr +[*⊤:struct] TOP->PTR_TOP - - + + STRUCT_TOP - -⊤:struct -[struct top] + +⊤:struct +[struct top] TOP->STRUCT_TOP - - + + MEM_TOP - -⊤:mem + +⊤:mem TOP->MEM_TOP - - + + TUPLE_TOP - -⊤:tuple + +⊤:tuple TOP->TUPLE_TOP - - + + @@ -155,7 +155,7 @@ XCTRL->CTRL - + @@ -174,8 +174,8 @@ INT_TOP->INT_NEG - - + + @@ -186,8 +186,8 @@ INT_TOP->INT_ZERO - - + + @@ -198,8 +198,8 @@ INT_TOP->INT_POS - - + + @@ -237,38 +237,38 @@ FLT_MINDOTS - -… negative constants + +… negative constants FLT_TOP->FLT_MINDOTS - - + + FLT_ZERO - -0.0 + +0.0 FLT_TOP->FLT_ZERO - - + + FLT_MAXDOTS - -positive constants … + +positive constants … FLT_TOP->FLT_MAXDOTS - - + + @@ -287,70 +287,70 @@ FLT_MINDOTS->FLT_BOT - - + + FLT_ZERO->FLT_BOT - - + + FLT_MAXDOTS->FLT_BOT - - + + PTR_NULL - -null + +null PTR_TOP->PTR_NULL - - + + PTR_PERSON - -*Person + +*Person PTR_TOP->PTR_PERSON - - + + PTR_S1 - -*s1 + +*s1 PTR_TOP->PTR_S1 - - + + PTR_MORE - -*s2, … + +*s2, … PTR_TOP->PTR_MORE - - + + @@ -375,8 +375,8 @@ PTR_NULL->PTR_PERSON_NIL - - + + @@ -387,8 +387,8 @@ PTR_NULL->PTR_S1_NIL - - + + @@ -399,8 +399,8 @@ PTR_NULL->PTR_MORE_NIL - - + + @@ -419,41 +419,41 @@ 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 - - + + @@ -485,8 +485,8 @@ STRUCT_TOP->STRUCT_PERSON - - + + @@ -498,8 +498,8 @@ STRUCT_TOP->STRUCT_S1 - - + + @@ -511,8 +511,8 @@ STRUCT_TOP->STRUCT_S2 - - + + @@ -523,8 +523,8 @@ STRUCT_TOP->STRUCT_MORE - - + + @@ -576,8 +576,8 @@ MEM_TOP->MEM_ALIAS2 - - + + @@ -588,8 +588,8 @@ MEM_TOP->MEM_ALIAS3 - - + + @@ -600,8 +600,8 @@ MEM_TOP->MEM_MORE - - + + @@ -639,70 +639,94 @@ TUPLE1 - -(type) + + + +tuple + + +type TUPLE_TOP->TUPLE1 - - + + TUPLE2 - -(type, type) + + + +tuple + + +type + + +type TUPLE_TOP->TUPLE2 - - + + TUPLEN - -(type, …) + + + +tuple + + +type + + +… + + +type TUPLE_TOP->TUPLEN - - + + TUPLE_BOT - -⊥:tuple + +⊥:tuple TUPLE_BOT->BOT - - + + TUPLE1->TUPLE_BOT - - + + TUPLE2->TUPLE_BOT - - + + TUPLEN->TUPLE_BOT - - + + -- cgit v1.2.3