From 0caf37adc5f8c1600f13d80aaf77361f407c9694 Mon Sep 17 00:00:00 2001 From: Dibyendu Majumdar Date: Thu, 2 May 2024 22:08:06 +0100 Subject: Documentation updates (#76) * More clearly explain why we do not have an AST in the implementation * Improve the description of type lattice. Cross reference to future chapters. * Minor update * Add lattice visual Revise the text describing meet. * minor update * Add a lattice visual to the text * Update the lattice visual. Add description of the new edges in the SoN graph --- chapter04/docs/build-graphs.sh | 2 + chapter04/docs/lattice.gv | 63 +++++++++++++ chapter04/docs/lattice.svg | 195 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 260 insertions(+) create mode 100644 chapter04/docs/build-graphs.sh create mode 100644 chapter04/docs/lattice.gv create mode 100644 chapter04/docs/lattice.svg (limited to 'chapter04/docs') diff --git a/chapter04/docs/build-graphs.sh b/chapter04/docs/build-graphs.sh new file mode 100644 index 00000000..d8038602 --- /dev/null +++ b/chapter04/docs/build-graphs.sh @@ -0,0 +1,2 @@ +dot -Tsvg lattice.gv > lattice.svg + diff --git a/chapter04/docs/lattice.gv b/chapter04/docs/lattice.gv new file mode 100644 index 00000000..2644448e --- /dev/null +++ b/chapter04/docs/lattice.gv @@ -0,0 +1,63 @@ +digraph Lattice { + // Define nodes + splines=false; + node [shape=circle, style=filled, fillcolor=lightblue]; + nodesep=0.6; + + TOP [label="⊤"]; + BOT [label="⊥"]; + + CTRL [label="Ctrl"]; + + INT_TOP [label="IntTop"]; + INT_BOT [label="IntBot"]; + + INT_MIN [label="-n"]; + INT_MINDOTS [label="..." shape=none style=none]; + INT_MINUS [label="-1"]; + INT_ZERO [label="0"]; + INT_PLUS [label="1"]; + INT_MAXDOTS [label="..." shape=none style=none]; + INT_MAX [label="+n"]; + + TUPLE [label="TUPLE"]; + + // Define edges + edge [arrowhead=none]; + + TOP -> INT_TOP; + INT_TOP -> INT_MIN; + INT_TOP -> INT_MINDOTS; + INT_TOP -> INT_MINUS; + INT_TOP -> INT_ZERO; + INT_TOP -> INT_PLUS; + INT_TOP -> INT_MAXDOTS; + INT_TOP -> INT_MAX; + INT_MIN -> INT_BOT; + INT_MINDOTS -> INT_BOT; + INT_MINUS -> INT_BOT; + INT_ZERO -> INT_BOT; + INT_PLUS -> INT_BOT; + INT_MAXDOTS -> INT_BOT; + INT_MAX -> INT_BOT; + INT_BOT -> BOT; + + INT_MIN -> INT_MINDOTS -> INT_MINUS -> INT_ZERO -> INT_PLUS -> INT_MAXDOTS -> INT_MAX [style=invis]; + + TOP -> TUPLE; + TUPLE -> BOT; + + TOP -> CTRL; + CTRL -> BOT; + + + // Additional customization + {rank=same; TOP} + {rank=same; INT_TOP} + {rank=same; CTRL; INT_MIN; INT_MINDOTS; + INT_MINUS; INT_ZERO; + INT_PLUS; INT_MAXDOTS; + INT_MAX; TUPLE} + {rank=same; INT_BOT} + {rank=same; BOT;} +} \ No newline at end of file diff --git a/chapter04/docs/lattice.svg b/chapter04/docs/lattice.svg new file mode 100644 index 00000000..0d403c20 --- /dev/null +++ b/chapter04/docs/lattice.svg @@ -0,0 +1,195 @@ + + + + + + +Lattice + + + +TOP + +⊤ + + + +CTRL + +Ctrl + + + +TOP->CTRL + + + + +INT_TOP + +IntTop + + + +TOP->INT_TOP + + + + +TUPLE + +TUPLE + + + +TOP->TUPLE + + + + +BOT + +⊥ + + + +CTRL->BOT + + + + +INT_MIN + +-n + + + +INT_TOP->INT_MIN + + + + +INT_MINDOTS +... + + + +INT_TOP->INT_MINDOTS + + + + +INT_MINUS + +-1 + + + +INT_TOP->INT_MINUS + + + + +INT_ZERO + +0 + + + +INT_TOP->INT_ZERO + + + + +INT_PLUS + +1 + + + +INT_TOP->INT_PLUS + + + + +INT_MAXDOTS +... + + + +INT_TOP->INT_MAXDOTS + + + + +INT_MAX + ++n + + + +INT_TOP->INT_MAX + + + + +INT_BOT + +IntBot + + + +INT_BOT->BOT + + + + +INT_MIN->INT_BOT + + + + + +INT_MINDOTS->INT_BOT + + + + + +INT_MINUS->INT_BOT + + + + + +INT_ZERO->INT_BOT + + + + + +INT_PLUS->INT_BOT + + + + + +INT_MAXDOTS->INT_BOT + + + + + +INT_MAX->INT_BOT + + + + +TUPLE->BOT + + + + -- cgit v1.2.3