From 65454d77eba95d7f814336377f78d9f42c7455f9 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Wed, 27 Nov 2024 11:29:33 -0800 Subject: More lattice docs reworks --- chapter10/docs/lattice.gv | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) (limited to 'chapter10/docs/lattice.gv') diff --git a/chapter10/docs/lattice.gv b/chapter10/docs/lattice.gv index 5ac1bd5a..7723e2a2 100644 --- a/chapter10/docs/lattice.gv +++ b/chapter10/docs/lattice.gv @@ -5,12 +5,12 @@ digraph Lattice { node [shape=circle, style=filled]; nodesep=0.6; - TOP [label=<⊤ >, fillcolor=black, fontcolor=white]; + TOP [label=<⊤>, fillcolor=black, fontcolor=white]; BOT [label=<⊥>, fillcolor=black, fontcolor=white]; // ---------------------- // Control - XCTRL [label=<⊤ :ctrl>, fillcolor=yellow, shape=oval]; + XCTRL [label=<⊤:ctrl>, fillcolor=yellow, shape=oval]; CTRL [label=<⊥:ctrl>, fillcolor=yellow, shape=oval]; TOP -> XCTRL; @@ -19,29 +19,23 @@ digraph Lattice { // ---------------------- // Integers - INT_TOP [label=<⊤ :int>, fillcolor=lightblue, shape=oval]; + INT_TOP [label=<⊤:int>, fillcolor=lightblue, shape=oval]; INT_BOT [label=<⊥:int>, fillcolor=lightblue, shape=oval]; - INT_MIN [label="-n" , fillcolor=lightblue]; INT_MINDOTS [label="...", fillcolor=lightblue, shape=oval]; INT_ZERO [label="0" , fillcolor=lightblue]; INT_MAXDOTS [label="...", fillcolor=lightblue, shape=oval]; - INT_MAX [label="+n" , fillcolor=lightblue]; TOP -> INT_TOP; - INT_TOP -> INT_MIN; INT_TOP -> INT_MINDOTS; INT_TOP -> INT_ZERO; INT_TOP -> INT_MAXDOTS; - INT_TOP -> INT_MAX; - INT_MIN -> INT_BOT; INT_MINDOTS -> INT_BOT; INT_ZERO -> INT_BOT; INT_MAXDOTS -> INT_BOT; - INT_MAX -> INT_BOT; INT_BOT -> BOT; - INT_MIN -> INT_MINDOTS -> INT_ZERO -> INT_MAXDOTS -> INT_MAX [style=invis]; + INT_MINDOTS -> INT_ZERO -> INT_MAXDOTS [style=invis]; // ---------------------- // Pointers, just a boolean nil/not and a struct @@ -64,28 +58,28 @@ digraph Lattice { // ---------------------- // Structs - STRUCT_TOP [label=<⊤:struct>, fillcolor=lightgreen, shape=oval]; + 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
fieldint/ptr
>]; STRUCT_S2 [shape=none, fillcolor=none, label=< - - + +
fieldint:ptr
fieldint:ptr
fieldint/ptr
fieldint/ptr
>]; STRUCT_SN [shape=none, fillcolor=none, label=< - - - + + +
fieldint:ptr
... int:ptr
fieldint:ptr
fieldint/ptr
... int/ptr
fieldint/ptr
>]; - STRUCT_BOT [label=<⊥:struct>, fillcolor=lightgreen, shape=oval] TOP -> STRUCT_TOP; STRUCT_TOP -> STRUCT_S1; @@ -100,11 +94,11 @@ digraph Lattice { // ---------------------- // Memory - MEM_TOP [label=<⊤:mem>, fillcolor=blue, fontcolor=white, shape=oval]; + 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]; - MEM_BOT [label=<⊥:mem>, fillcolor=blue, fontcolor=white, shape=oval]; TOP -> MEM_TOP; MEM_TOP -> MEM_ALIAS1; @@ -120,7 +114,8 @@ digraph Lattice { // ---------------------- // Tuples - TUPLE_TOP [label=<⊤:tuple>, fillcolor=pink, shape=oval]; + TUPLE_TOP [label=<⊤:tuple>, fillcolor=pink, shape=oval]; + TUPLE_BOT [label=<⊥:tuple>, fillcolor=pink, shape=oval]; TUPLE1 [shape=none, fillcolor=none, label=< @@ -144,7 +139,6 @@ digraph Lattice {
>]; - TUPLE_BOT [label=<⊥:tuple>, fillcolor=pink, shape=oval]; TOP -> TUPLE_TOP; TUPLE_TOP -> TUPLE1; @@ -159,11 +153,9 @@ digraph Lattice { // Additional customization {rank=same; TOP;} {rank=same; INT_TOP; XCTRL; STRUCT_TOP; MEM_TOP; TUPLE_TOP} - {rank=same; INT_MIN; INT_MINDOTS; - INT_ZERO; INT_MAXDOTS; - INT_MAX; STRUCT_S1; STRUCT_S2; STRUCT_SN; - MEM_ALIAS1; - MEM_ALIASDOTS; MEM_ALIASN;} + {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;} } -- cgit v1.2.3