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 --- chapter06/docs/build-graphs.sh | 2 + chapter06/docs/lattice.gv | 64 +++++++++++++ chapter06/docs/lattice.svg | 206 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 272 insertions(+) create mode 100644 chapter06/docs/lattice.gv create mode 100644 chapter06/docs/lattice.svg (limited to 'chapter06/docs') diff --git a/chapter06/docs/build-graphs.sh b/chapter06/docs/build-graphs.sh index 5238dbfc..44d2de3a 100644 --- a/chapter06/docs/build-graphs.sh +++ b/chapter06/docs/build-graphs.sh @@ -9,3 +9,5 @@ dot -Tsvg 06-graph3-false.gv > 06-graph3-false.svg dot -Tsvg 06-graph4-nonconst.gv > 06-graph4-nonconst.svg dot -Tsvg 06-graph4-true.gv > 06-graph4-true.svg dot -Tsvg 06-graph4-arg2.gv > 06-graph4-arg2.svg +dot -Tsvg lattice.gv > lattice.svg + diff --git a/chapter06/docs/lattice.gv b/chapter06/docs/lattice.gv new file mode 100644 index 00000000..2cf27452 --- /dev/null +++ b/chapter06/docs/lattice.gv @@ -0,0 +1,64 @@ +digraph Lattice { + // Define nodes + splines=false; + node [shape=circle, style=filled, fillcolor=lightblue]; + nodesep=0.6; + + TOP [label="⊤"]; + BOT [label="⊥"]; + + XCTRL [label="~Ctrl"]; + 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 -> XCTRL; + XCTRL -> CTRL; + CTRL -> BOT; + + // Additional customization + {rank=same; TOP} + {rank=same; INT_TOP; XCTRL} + {rank=same; INT_MIN; INT_MINDOTS; + INT_MINUS; INT_ZERO; + INT_PLUS; INT_MAXDOTS; + INT_MAX; TUPLE} + {rank=same; INT_BOT; CTRL} + {rank=same; BOT;} +} \ No newline at end of file diff --git a/chapter06/docs/lattice.svg b/chapter06/docs/lattice.svg new file mode 100644 index 00000000..713b54c1 --- /dev/null +++ b/chapter06/docs/lattice.svg @@ -0,0 +1,206 @@ + + + + + + +Lattice + + + +TOP + +⊤ + + + +XCTRL + +~Ctrl + + + +TOP->XCTRL + + + + +INT_TOP + +IntTop + + + +TOP->INT_TOP + + + + +TUPLE + +TUPLE + + + +TOP->TUPLE + + + + +BOT + +⊥ + + + +CTRL + +Ctrl + + + +XCTRL->CTRL + + + + +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