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 --- chapter14/docs/lattice.gv | 25 ++- chapter14/docs/lattice.svg | 430 ++++++++++++++++++++++++--------------------- 2 files changed, 249 insertions(+), 206 deletions(-) (limited to 'chapter14/docs') diff --git a/chapter14/docs/lattice.gv b/chapter14/docs/lattice.gv index ac2f1f2e..5fd97a52 100644 --- a/chapter14/docs/lattice.gv +++ b/chapter14/docs/lattice.gv @@ -142,9 +142,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/chapter14/docs/lattice.svg b/chapter14/docs/lattice.svg index 131b5601..9db77f7a 100644 --- a/chapter14/docs/lattice.svg +++ b/chapter14/docs/lattice.svg @@ -4,142 +4,142 @@ - - + + Lattice - + cluster_control - -Control + +Control cluster_integer - -Integer ranges (schematic) + +Integer ranges (schematic) 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 - - + + @@ -156,7 +156,7 @@ XCTRL->CTRL - + @@ -169,14 +169,14 @@ INT_HI - -max < min + +max < min INT_TOP->INT_HI - - + + @@ -195,50 +195,50 @@ INT_XBOOL - -1...0 + +1...0 INT_HI->INT_XBOOL - - + + INT_CON - -constants + +constants INT_HI->INT_CON - - + + INT_CON0 - -0 + +0 INT_XBOOL->INT_CON0 - - + + INT_CON1 - -1 + +1 INT_XBOOL->INT_CON1 - - + + @@ -249,8 +249,8 @@ INT_CON->INT_LO - - + + @@ -262,15 +262,15 @@ INT_CON0->INT_BOOL - - + + INT_CON1->INT_BOOL - - + + @@ -287,40 +287,40 @@ FLT_CON64 - -64b consts -[excludes -32b consts] + +64b consts +[excludes +32b consts] FLT_TOP->FLT_CON64 - - + + FLT_CONPI - -3.14159... + +3.14159... FLT_TOP->FLT_CONPI - - + + FLT_X32 - -~f32 + +~f32 FLT_TOP->FLT_X32 - - + + @@ -339,113 +339,113 @@ FLT_CON64->FLT_BOT - - + + FLT_CON32 - -32b consts + +32b consts FLT_32 - -f32 + +f32 FLT_CON32->FLT_32 - - + + FLT_CONPI->FLT_BOT - - + + FLT_X32->FLT_CON32 - - + + FLT_CON0 - -0. + +0. FLT_X32->FLT_CON0 - - + + FLT_CON0->FLT_32 - - + + FLT_32->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 - - + + @@ -464,111 +464,111 @@ PTR_PERSON_NIL - -*Person? + +*Person? PTR_NULL->PTR_PERSON_NIL - - + + PTR_S1_NIL - -*s1? + +*s1? PTR_NULL->PTR_S1_NIL - - + + PTR_MORE_NIL - -*s2?, … + +*s2?, … PTR_NULL->PTR_MORE_NIL - - + + PTR_ANY - -*⊥:struct -[ptr any struct] + +*⊥: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 - - + + @@ -580,8 +580,8 @@ STRUCT_TOP->STRUCT_PERSON - - + + @@ -593,8 +593,8 @@ STRUCT_TOP->STRUCT_S1 - - + + @@ -606,8 +606,8 @@ STRUCT_TOP->STRUCT_S2 - - + + @@ -618,8 +618,8 @@ STRUCT_TOP->STRUCT_MORE - - + + @@ -671,8 +671,8 @@ MEM_TOP->MEM_ALIAS2 - - + + @@ -683,8 +683,8 @@ MEM_TOP->MEM_ALIAS3 - - + + @@ -695,8 +695,8 @@ MEM_TOP->MEM_MORE - - + + @@ -734,70 +734,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