From c3958e34c0de21df52e57e47e4f47ffe6464f138 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 3 Oct 2026 09:29:42 -0700 Subject: Graph updates; readme updates --- chapter01/docs/01-graph.svg | 2 +- chapter02/docs/02-demonstration-peephole.svg | 2 +- .../docs/02-demonstration-pre-peephole-nokill.svg | 2 +- chapter02/docs/02-demonstration-pre-peephole.svg | 2 +- chapter02/docs/02-post-peephole-ex1.svg | 2 +- chapter02/docs/02-pre-peephole-ex1.svg | 2 +- chapter03/docs/03-graph1.svg | 2 +- chapter03/docs/03-graph2.svg | 2 +- chapter03/docs/03-graph3.svg | 2 +- chapter04/docs/04-arg1.svg | 2 +- chapter04/docs/04-arg2.svg | 2 +- chapter04/docs/04-post-peephole.svg | 2 +- chapter04/docs/04-pre-peephole.svg | 2 +- chapter05/README.md | 11 ++ chapter05/docs/05-graph1.svg | 2 +- chapter05/docs/05-graph2.svg | 2 +- chapter05/docs/05-graph3.svg | 2 +- chapter05/docs/05-graph4.json | 15 +- chapter05/docs/05-graph4.svg | 56 ++----- chapter05/docs/05-graph5.json | 15 +- chapter05/docs/05-graph5.svg | 54 ++----- chapter05/docs/05-graph6.json | 17 +- chapter05/docs/05-graph6.svg | 55 +------ chapter05/docs/05-graph7.json | 17 +- chapter05/docs/05-graph7.svg | 64 ++------ chapter05/docs/05-graph8.svg | 2 +- chapter05/docs/05-graph9.svg | 2 +- chapter06/docs/06-graph1-post.svg | 2 +- chapter06/docs/06-graph1-pre.svg | 2 +- chapter06/docs/06-graph2-post.svg | 2 +- chapter06/docs/06-graph2-pre.svg | 2 +- chapter06/docs/06-graph3-nonconst-peephole.svg | 2 +- chapter06/docs/06-graph3-nonconst.svg | 2 +- chapter07/docs/07-graph1.svg | 2 +- chapter07/docs/07-graph2.svg | 2 +- chapter07/docs/07-graph3.svg | 2 +- chapter07/docs/07-graph4.svg | 2 +- chapter08/docs/08-graph1.svg | 2 +- chapter08/docs/08-graph2.svg | 2 +- chapter08/docs/08-graph3.svg | 2 +- chapter09/README.md | 8 + chapter09/docs/09-graph1.json | 11 +- chapter09/docs/09-graph1.svg | 50 ++---- chapter09/docs/09-graph2.json | 11 +- chapter09/docs/09-graph2.svg | 46 ++---- chapter09/docs/09-graph3.json | 6 +- chapter09/docs/09-graph3.svg | 25 ++- chapter09/docs/09-graph4.json | 7 +- chapter09/docs/09-graph4.svg | 20 +-- chapter09/docs/09-graph5.json | 15 +- chapter09/docs/09-graph5.svg | 54 ++----- chapter09/docs/09-graph6.json | 15 +- chapter09/docs/09-graph6.svg | 52 ++---- chapter10a/README.md | 43 +++++ chapter12/README.md | 5 - chapter13/README.md | 180 +++++++-------------- chapter14/README.md | 4 - docs/chapter-backports.md | 8 + graph/README.md | 12 ++ graph/web/layout.js | 7 +- 60 files changed, 318 insertions(+), 627 deletions(-) diff --git a/chapter01/docs/01-graph.svg b/chapter01/docs/01-graph.svg index d8ec5cb7..6f1d8204 100644 --- a/chapter01/docs/01-graph.svg +++ b/chapter01/docs/01-graph.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - #2[0] → #1 · ASSOC#3[0] → #1 · CTRL#3[1] → #2 · DATAStart  #1#1 Start + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · CTRL#3[1] → #2 · DATAStart  #1#1 Start Type not computed #1  #2#2 #1 diff --git a/chapter02/docs/02-demonstration-peephole.svg b/chapter02/docs/02-demonstration-peephole.svg index dfc03cff..6742dc47 100644 --- a/chapter02/docs/02-demonstration-peephole.svg +++ b/chapter02/docs/02-demonstration-peephole.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e5i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[0] → #1 · ASSOC#6[0] → #1 · CTRL#6[1] → #5 · DATAStart  #1#1 Start + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e5i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#5[0] → #1 · ASSOC#6[0] → #1 · CTRL#6[1] → #5 · DATAStart  #1#1 Start Type not computed #3  #5#5 #3 diff --git a/chapter02/docs/02-demonstration-pre-peephole-nokill.svg b/chapter02/docs/02-demonstration-pre-peephole-nokill.svg index a40e5981..f581be2c 100644 --- a/chapter02/docs/02-demonstration-pre-peephole-nokill.svg +++ b/chapter02/docs/02-demonstration-pre-peephole-nokill.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[1] → #2 · DATA#4[2] → #3 · DATA#5[0] → #1 · ASSOC#6[0] → #1 · CTRL#6[1] → #5 · DATAStart  #1#1 Start + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,77 C84,101 388,3 388,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[1] → #2 · DATA#4[2] → #3 · DATA#5[0] → #1 · ASSOC#6[0] → #1 · CTRL#6[1] → #5 · DATAStart  #1#1 Start Type not computed #1  #2#2 #1 diff --git a/chapter02/docs/02-demonstration-pre-peephole.svg b/chapter02/docs/02-demonstration-pre-peephole.svg index 8809a0c0..a8319f8b 100644 --- a/chapter02/docs/02-demonstration-pre-peephole.svg +++ b/chapter02/docs/02-demonstration-pre-peephole.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,181 C84,205 114,3 114,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[1] → #2 · DATA#4[2] → #3 · DATA#5[0] → #1 · CTRL#5[1] → #4 · DATAStart  #1#1 Start + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M84,181 C84,205 114,3 114,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[1] → #2 · DATA#4[2] → #3 · DATA#5[0] → #1 · CTRL#5[1] → #4 · DATAStart  #1#1 Start Type not computed #1  #2#2 #1 diff --git a/chapter02/docs/02-post-peephole-ex1.svg b/chapter02/docs/02-post-peephole-ex1.svg index 6674839e..2f9fc49d 100644 --- a/chapter02/docs/02-post-peephole-ex1.svg +++ b/chapter02/docs/02-post-peephole-ex1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e13i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#13[0] → #1 · ASSOC#14[0] → #1 · CTRL#14[1] → #13 · DATAStart  #1#1 Start + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e13i0" d="M84,77 C84,101 236,3 236,27" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#13[0] → #1 · ASSOC#14[0] → #1 · CTRL#14[1] → #13 · DATAStart  #1#1 Start Type not computed #2  #13#13 #2 diff --git a/chapter02/docs/02-pre-peephole-ex1.svg b/chapter02/docs/02-pre-peephole-ex1.svg index e2e5f785..0217cdd0 100644 --- a/chapter02/docs/02-pre-peephole-ex1.svg +++ b/chapter02/docs/02-pre-peephole-ex1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M146,389 C146,413 176,211 176,235" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[0] → #1 · ASSOC#5[1] → #3 · DATA#5[2] → #4 · DATA#6[0] → #1 · ASSOC#7[1] → #6 · DATA#8[1] → #5 · DATA#8[2] → #7 · DATA#9[1] → #2 · DATA#9[2] → #8 · DATA#10[0] → #1 · CTRL#10[1] → #9 · DATAStart  #1#1 Start + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e2i0" d="M146,389 C146,413 176,211 176,235" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#2[0] → #1 · ASSOC#3[0] → #1 · ASSOC#4[0] → #1 · ASSOC#5[1] → #3 · DATA#5[2] → #4 · DATA#6[0] → #1 · ASSOC#7[1] → #6 · DATA#8[1] → #5 · DATA#8[2] → #7 · DATA#9[1] → #2 · DATA#9[2] → #8 · DATA#10[0] → #1 · CTRL#10[1] → #9 · DATAStart  #1#1 Start Type not computed #1  #2#2 #1 diff --git a/chapter03/docs/03-graph1.svg b/chapter03/docs/03-graph1.svg index 9ad933d5..0ecaffac 100644 --- a/chapter03/docs/03-graph1.svg +++ b/chapter03/docs/03-graph1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 696,74 696,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a#1[1] → #4 · ASSOC · 0: b#1[2] → #7 · ASSOC · 0: c#1[3] → #6 · ASSOC · 1: b#3[0] → #2 · ASSOC#4[0] → #2 · ASSOC#6[0] → #2 · ASSOC#7[1] → #3 · DATA#7[2] → #6 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 696,74 696,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a#1[1] → #4 · ASSOC · 0: b#1[2] → #7 · ASSOC · 0: c#1[3] → #6 · ASSOC · 1: b#3[0] → #2 · ASSOC#4[0] → #2 · ASSOC#6[0] → #2 · ASSOC#7[1] → #3 · DATA#7[2] → #6 · DATAScope  #1#1 Scope Type not computed [0] → #3 ASSOC 0: a diff --git a/chapter03/docs/03-graph2.svg b/chapter03/docs/03-graph2.svg index d59e5dc0..3904d87e 100644 --- a/chapter03/docs/03-graph2.svg +++ b/chapter03/docs/03-graph2.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 696,74 696,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a#1[1] → #4 · ASSOC · 0: b#1[2] → #7 · ASSOC · 0: c#3[0] → #2 · ASSOC#4[0] → #2 · ASSOC#6[0] → #2 · ASSOC#7[1] → #3 · DATA#7[2] → #6 · DATA#8[0] → #2 · CTRL#8[1] → #7 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M236,77 C236,101 696,74 696,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #3 · ASSOC · 0: a#1[1] → #4 · ASSOC · 0: b#1[2] → #7 · ASSOC · 0: c#3[0] → #2 · ASSOC#4[0] → #2 · ASSOC#6[0] → #2 · ASSOC#7[1] → #3 · DATA#7[2] → #6 · DATA#8[0] → #2 · CTRL#8[1] → #7 · DATAScope  #1#1 Scope Type not computed [0] → #3 ASSOC 0: a diff --git a/chapter03/docs/03-graph3.svg b/chapter03/docs/03-graph3.svg index 89eed120..4c5db5e0 100644 --- a/chapter03/docs/03-graph3.svg +++ b/chapter03/docs/03-graph3.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M388,77 C388,101 1001.5,74 1001.5,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #4 · ASSOC · 0: y0#1[1] → #3 · ASSOC · 0: x0#1[2] → #6 · ASSOC · 0: y1#1[3] → #5 · ASSOC · 0: x1#3[0] → #2 · ASSOC#4[0] → #2 · ASSOC#5[0] → #2 · ASSOC#6[0] → #2 · ASSOC#20[0] → #2 · ASSOC#21[0] → #2 · CTRL#21[1] → #20 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M388,77 C388,101 1001.5,74 1001.5,98" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #4 · ASSOC · 0: y0#1[1] → #3 · ASSOC · 0: x0#1[2] → #6 · ASSOC · 0: y1#1[3] → #5 · ASSOC · 0: x1#3[0] → #2 · ASSOC#4[0] → #2 · ASSOC#5[0] → #2 · ASSOC#6[0] → #2 · ASSOC#20[0] → #2 · ASSOC#21[0] → #2 · CTRL#21[1] → #20 · DATAScope  #1#1 Scope Type not computed [0] → #4 ASSOC 0: y0 diff --git a/chapter04/docs/04-arg1.svg b/chapter04/docs/04-arg1.svg index b948e7cd..b726b91f 100644 --- a/chapter04/docs/04-arg1.svg +++ b/chapter04/docs/04-arg1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M242,115 C242,139 465.5,0 465.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg#6[0] → #4 · CTRL#6[1] → #5 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M242,115 C242,139 465.5,0 465.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg#6[0] → #4 · CTRL#6[1] → #5 · DATAScope  #1#1 Scope Type not computed [0] → — ASSOC 0: $ctrl diff --git a/chapter04/docs/04-arg2.svg b/chapter04/docs/04-arg2.svg index aebd8b0d..6083ae9b 100644 --- a/chapter04/docs/04-arg2.svg +++ b/chapter04/docs/04-arg2.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 433.5,0 433.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #6 · ASSOC · 0: arg#5[0] → #4 · CTRL#5[1] → #6 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 433.5,0 433.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #6 · ASSOC · 0: arg#5[0] → #4 · CTRL#5[1] → #6 · DATAScope  #1#1 Scope Type not computed [0] → — ASSOC 0: $ctrl diff --git a/chapter04/docs/04-post-peephole.svg b/chapter04/docs/04-post-peephole.svg index 530155dd..d03218d6 100644 --- a/chapter04/docs/04-post-peephole.svg +++ b/chapter04/docs/04-post-peephole.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 585.5,0 585.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg#11[1] → #5 · DATA#11[2] → #10 · DATA#12[0] → #4 · CTRL#12[1] → #11 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 585.5,0 585.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #5 · ASSOC · 0: arg#11[1] → #5 · DATA#11[2] → #10 · DATA#12[0] → #4 · CTRL#12[1] → #11 · DATAScope  #1#1 Scope Type not computed [0] → — ASSOC 0: $ctrl diff --git a/chapter04/docs/04-pre-peephole.svg b/chapter04/docs/04-pre-peephole.svg index 5ad17b13..813a48dd 100644 --- a/chapter04/docs/04-pre-peephole.svg +++ b/chapter04/docs/04-pre-peephole.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 585.5,0 585.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #10 · ASSOC · 0: arg#7[1] → #10 · DATA#7[2] → #6 · DATA#8[1] → #5 · DATA#8[2] → #7 · DATA#9[0] → #4 · CTRL#9[1] → #8 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M204,115 C204,139 585.5,0 585.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #10 · ASSOC · 0: arg#7[1] → #10 · DATA#7[2] → #6 · DATA#8[1] → #5 · DATA#8[2] → #7 · DATA#9[0] → #4 · CTRL#9[1] → #8 · DATAScope  #1#1 Scope Type not computed [0] → — ASSOC 0: $ctrl diff --git a/chapter05/README.md b/chapter05/README.md index c507df07..426da6fb 100644 --- a/chapter05/README.md +++ b/chapter05/README.md @@ -297,6 +297,10 @@ if( arg==1 ) return a; ``` +The next two diagrams focus on the value rewrite. The unchanged `if` and +Region are omitted; Phi input 1 is the true arm and input 2 the false arm. +The Phis still use the same Region in the compiler's graph. + Pre-peephole we have: ![Graph4](./docs/05-graph4.svg) @@ -359,6 +363,10 @@ reason this pair of opposing rewrites terminates. ## More examples + +The next two simple `if` examples also omit control flow to highlight the +resulting values. Their Phi inputs retain the true/false order above. + ```java int c = 3; int b = 2; @@ -383,6 +391,9 @@ return a+b; ![Graph7](./docs/05-graph7.svg) +For nested branches, the control paths and Regions are shown so each Phi's +incoming paths remain clear: + ```java int a=1; if( arg==1 ) diff --git a/chapter05/docs/05-graph1.svg b/chapter05/docs/05-graph1.svg index 97813974..0a75532a 100644 --- a/chapter05/docs/05-graph1.svg +++ b/chapter05/docs/05-graph1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M84,367 C84,391 848.5,364 848.5,388" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #11 · ASSOC · 0: $ctrl#1[1] → #10 · ASSOC · 0: arg#1[2] → #14 · ASSOC · 1: a#4[0] → #12 · ASSOC · 0: $ctrl#4[1] → #10 · ASSOC · 0: arg#4[2] → #16 · ASSOC · 1: a#8[1] → #10 · DATA#8[2] → #7 · DATA#9[0] → #6 · CTRL#9[1] → #8 · DATA#14[1] → #10 · DATA#14[2] → #13 · DATA#16[1] → #10 · DATA#16[2] → #15 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M84,367 C84,391 848.5,364 848.5,388" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #11 · ASSOC · 0: $ctrl#1[1] → #10 · ASSOC · 0: arg#1[2] → #14 · ASSOC · 1: a#4[0] → #12 · ASSOC · 0: $ctrl#4[1] → #10 · ASSOC · 0: arg#4[2] → #16 · ASSOC · 1: a#8[1] → #10 · DATA#8[2] → #7 · DATA#9[0] → #6 · CTRL#9[1] → #8 · DATA#14[1] → #10 · DATA#14[2] → #13 · DATA#16[1] → #10 · DATA#16[2] → #15 · DATAScope  #1#1 Scope Type not computed [0] → #11 ASSOC 0: $ctrl diff --git a/chapter05/docs/05-graph2.svg b/chapter05/docs/05-graph2.svg index bd06978a..f073e342 100644 --- a/chapter05/docs/05-graph2.svg +++ b/chapter05/docs/05-graph2.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M306,530 C306,554 838.5,527 838.5,551" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #17 · ASSOC · 0: $ctrl#1[1] → #5 · ASSOC · 0: arg#1[2] → #18 · ASSOC · 1: a#8[1] → #5 · DATA#8[2] → #7 · DATA#9[0] → #4 · CTRL#9[1] → #8 · DATA#14[1] → #5 · DATA#14[2] → #13 · DATA#16[1] → #5 · DATA#16[2] → #15 · DATA#17[1] → #6 · CTRL#17[2] → #10 · CTRL#18[1] → #14 · DATA#18[2] → #16 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M306,530 C306,554 838.5,527 838.5,551" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #17 · ASSOC · 0: $ctrl#1[1] → #5 · ASSOC · 0: arg#1[2] → #18 · ASSOC · 1: a#8[1] → #5 · DATA#8[2] → #7 · DATA#9[0] → #4 · CTRL#9[1] → #8 · DATA#14[1] → #5 · DATA#14[2] → #13 · DATA#16[1] → #5 · DATA#16[2] → #15 · DATA#17[1] → #6 · CTRL#17[2] → #10 · CTRL#18[1] → #14 · DATA#18[2] → #16 · DATAScope  #1#1 Scope Type not computed [0] → #17 ASSOC 0: $ctrl diff --git a/chapter05/docs/05-graph3.svg b/chapter05/docs/05-graph3.svg index 50255072..5a8b5706 100644 --- a/chapter05/docs/05-graph3.svg +++ b/chapter05/docs/05-graph3.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M326,651 C326,675 380,678 380,702" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #19 · CTRL#8[1] → #4 · DATA#8[2] → #7 · DATA#9[0] → #1 · CTRL#9[1] → #8 · DATA#14[1] → #4 · DATA#14[2] → #13 · DATA#16[1] → #4 · DATA#16[2] → #15 · DATA#17[1] → #5 · CTRL#17[2] → #6 · CTRL#18[1] → #14 · DATA#18[2] → #16 · DATA#19[0] → #17 · CTRL#19[1] → #18 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M326,651 C326,675 380,678 380,702" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #19 · CTRL#8[1] → #4 · DATA#8[2] → #7 · DATA#9[0] → #1 · CTRL#9[1] → #8 · DATA#14[1] → #4 · DATA#14[2] → #13 · DATA#16[1] → #4 · DATA#16[2] → #15 · DATA#17[1] → #5 · CTRL#17[2] → #6 · CTRL#18[1] → #14 · DATA#18[2] → #16 · DATA#19[0] → #17 · CTRL#19[1] → #18 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter05/docs/05-graph4.json b/chapter05/docs/05-graph4.json index 36527f8d..a23b54f7 100644 --- a/chapter05/docs/05-graph4.json +++ b/chapter05/docs/05-graph4.json @@ -2,27 +2,18 @@ "ver": 1, "comp": "chapter05/docs/05-graph4.svg", "step": 1, - "roots": [], + "roots": [18], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, {"id": 6, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 7, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, - {"id": 8, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, - {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, - {"id": 11, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, {"id": 14, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 15, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 14, "role": "DATA", "label": null}], "proj": null}, - {"id": 16, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 11, "role": "CTRL", "label": null}], "proj": null}, - {"id": 17, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 16, "role": "ASSOC", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, - {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null} + {"id": 17, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, + {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null} ], "groups": [ - {"id": 10, "par": 0, "nodes": [5, 7, 9, 10, 11, 15, 16, 17]} ] } diff --git a/chapter05/docs/05-graph4.svg b/chapter05/docs/05-graph4.svg index 58f0cb18..45a3d3f3 100644 --- a/chapter05/docs/05-graph4.svg +++ b/chapter05/docs/05-graph4.svg @@ -1,4 +1,4 @@ -<svg aria-label="Compiler graph" width="760" height="752" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 760 752" style="font-family: sans-serif;"><style> +<svg aria-label="Compiler graph" width="478" height="454" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 478 454" style="font-family: sans-serif;"><style> html, body { height:100%; margin:0; font-family:sans-serif; } .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } .source { padding:8px; border-bottom:1px solid #ccc; } @@ -60,68 +60,36 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(144,171)"><rect class="region-box" rx="8" width="574" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M326,651 C326,675 380,678 380,702" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #18 · CTRL#7[1] → #4 · DATA#7[2] → #6 · DATA#9[1] → #4 · DATA#9[2] → #8 · DATA#10[0] → #1 · CTRL#10[1] → #9 · DATA#15[1] → #4 · DATA#15[2] → #14 · DATA#16[1] → #5 · CTRL#16[2] → #11 · CTRL#17[1] → #15 · DATA#17[2] → #7 · DATA#18[0] → #16 · CTRL#18[1] → #17 · DATA$ctrl  #1/0#1 $ctrl -Projection 0 of #2 + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge DATA" id="e7i1" d="M84,118 L84,130 Q84,138 92,138 L228,138 Q236,138 236,146 L236,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#7[1] → #4 · DATA#7[2] → #6 · DATA#15[1] → #4 · DATA#15[2] → #14 · DATA#17[1] → #15 · DATA#17[2] → #7 · DATA#18[1] → #17 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #18 CTRL0arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #10 -Type not computed - -[0] → #10 CTRL#2  #6#6 #2 +[0] → #2 DATA#2  #6#6 #2 Type not computed -==  #7#7 == +==  #7#7 == Type not computed [0] → — DATA [1] → #4 DATA -[2] → #6 DATA012#1  #8#8 #1 +[2] → #6 DATA012#3  #14#14 #3 Type not computed -==  #9#9 == +==  #15#15 == Type not computed [0] → — DATA [1] → #4 DATA -[2] → #8 DATA012If  #10#10 If -Type not computed - -[0] → #1 CTRL -[1] → #9 DATA01False  #11/1#11 False -Projection 1 of #10 -Type not computed - -[0] → #10 CTRL#3  #14#14 #3 -Type not computed - -==  #15#15 == -Type not computed - -[0] → — DATA -[1] → #4 DATA -[2] → #14 DATA012Region  #16#16 Region -Type not computed - -[0] → — DATA -[1] → #5 CTRL -[2] → #11 CTRL012φ_a  #17#17 φ_a +[2] → #14 DATA012φ_a  #17#17 φ_a Type not computed -[0] → #16 ASSOC +[0] → — ASSOC [1] → #15 DATA -[2] → #7 DATA[0] → #16012Return  #18#18 Return +[2] → #7 DATA012Return  #18#18 Return Type not computed -[0] → #16 CTRL -[1] → #17 DATA01If  #10If · 8 nodes−Fold region +[0] → — CTRL +[1] → #17 DATA01 diff --git a/chapter05/docs/05-graph5.json b/chapter05/docs/05-graph5.json index b9dc070b..3bce2865 100644 --- a/chapter05/docs/05-graph5.json +++ b/chapter05/docs/05-graph5.json @@ -2,26 +2,17 @@ "ver": 1, "comp": "chapter05/docs/05-graph5.svg", "step": 1, - "roots": [], + "roots": [21], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, {"id": 6, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, - {"id": 8, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, - {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, {"id": 14, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 16, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 7, "role": "CTRL", "label": null}], "proj": null}, - {"id": 19, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 16, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "φ_a", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 14, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, {"id": 20, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 19, "role": "DATA", "label": null}], "proj": null}, - {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}], "proj": null} + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}], "proj": null} ], "groups": [ - {"id": 10, "par": 0, "nodes": [5, 7, 9, 10, 16, 19]} ] } diff --git a/chapter05/docs/05-graph5.svg b/chapter05/docs/05-graph5.svg index 4d137bda..df1144a9 100644 --- a/chapter05/docs/05-graph5.svg +++ b/chapter05/docs/05-graph5.svg @@ -1,4 +1,4 @@ -#19[1] → #14 · DATA#19[2] → #6 · DATA#20[1] → #4 · DATA#20[2] → #19 · DATA#21[1] → #20 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #21 CTRL0arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #10 -Type not computed - -[0] → #10 CTRL#2  #6#6 #2 -Type not computed - -False  #7/1#7 False -Projection 1 of #10 -Type not computed - -[0] → #10 CTRL#1  #8#8 #1 +[0] → #2 DATA#2  #6#6 #2 Type not computed -==  #9#9 == +#3  #14#14 #3 Type not computed -[0] → — DATA -[1] → #4 DATA -[2] → #8 DATA012If  #10#10 If -Type not computed - -[0] → #1 CTRL -[1] → #9 DATA01#3  #14#14 #3 -Type not computed - -Region  #16#16 Region -Type not computed - -[0] → — DATA -[1] → #5 CTRL -[2] → #7 CTRL012φ_a  #19#19 φ_a +φ_a  #19#19 φ_a Type not computed -[0] → #16 ASSOC +[0] → — ASSOC [1] → #14 DATA -[2] → #6 DATA[0] → #16012==  #20#20 == +[2] → #6 DATA012==  #20#20 == Type not computed [0] → — DATA [1] → #4 DATA -[2] → #19 DATA012Return  #21#21 Return +[2] → #19 DATA012Return  #21#21 Return Type not computed -[0] → #16 CTRL -[1] → #20 DATA01If  #10If · 6 nodes−Fold region +[0] → — CTRL +[1] → #20 DATA01 diff --git a/chapter05/docs/05-graph6.json b/chapter05/docs/05-graph6.json index 1039bb08..536b320c 100644 --- a/chapter05/docs/05-graph6.json +++ b/chapter05/docs/05-graph6.json @@ -2,25 +2,14 @@ "ver": 1, "comp": "chapter05/docs/05-graph6.svg", "step": 1, - "roots": [], + "roots": [19], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, - {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 19, "role": "CTRL", "label": null}], "proj": null}, - {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 0}}, {"id": 6, "label": "#3", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 7, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": {"par": 10, "idx": 1}}, - {"id": 8, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 9, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 8, "role": "DATA", "label": null}], "proj": null}, - {"id": 10, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, {"id": 15, "label": "#4", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 16, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 7, "role": "CTRL", "label": null}], "proj": null}, - {"id": 17, "label": "φ_c", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 16, "role": "ASSOC", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, - {"id": 19, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 16, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null} + {"id": 17, "label": "φ_c", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 15, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, + {"id": 19, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null} ], "groups": [ - {"id": 10, "par": 0, "nodes": [5, 7, 9, 10, 16, 17]} ] } diff --git a/chapter05/docs/05-graph6.svg b/chapter05/docs/05-graph6.svg index 831a6a07..f58a541f 100644 --- a/chapter05/docs/05-graph6.svg +++ b/chapter05/docs/05-graph6.svg @@ -1,4 +1,4 @@ -#17[1] → #15 · DATA#17[2] → #6 · DATA#19[1] → #17 · DATA#3  #6#6 #3 Type not computed -[0] → #2 CTRLStart  #2#2 Start +#4  #15#15 #4 Type not computed -Stop  #3#3 Stop +φ_c  #17#17 φ_c Type not computed -[0] → #19 CTRL0arg  #4/1#4 arg -Projection 1 of #2 -Type not computed - -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #10 -Type not computed - -[0] → #10 CTRL#3  #6#6 #3 -Type not computed - -False  #7/1#7 False -Projection 1 of #10 -Type not computed - -[0] → #10 CTRL#1  #8#8 #1 -Type not computed - -==  #9#9 == -Type not computed - -[0] → — DATA -[1] → #4 DATA -[2] → #8 DATA012If  #10#10 If -Type not computed - -[0] → #1 CTRL -[1] → #9 DATA01#4  #15#15 #4 -Type not computed - -Region  #16#16 Region -Type not computed - -[0] → — DATA -[1] → #5 CTRL -[2] → #7 CTRL012φ_c  #17#17 φ_c -Type not computed - -[0] → #16 ASSOC +[0] → — ASSOC [1] → #15 DATA -[2] → #6 DATA[0] → #16012Return  #19#19 Return +[2] → #6 DATA012Return  #19#19 Return Type not computed -[0] → #16 CTRL -[1] → #17 DATA01If  #10If · 6 nodes−Fold region +[0] → — CTRL +[1] → #17 DATA01 diff --git a/chapter05/docs/05-graph7.json b/chapter05/docs/05-graph7.json index df6cf547..2f4b4336 100644 --- a/chapter05/docs/05-graph7.json +++ b/chapter05/docs/05-graph7.json @@ -2,30 +2,21 @@ "ver": 1, "comp": "chapter05/docs/05-graph7.svg", "step": 1, - "roots": [], + "roots": [51], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 51, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 0}}, - {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 1}}, - {"id": 10, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 11, "label": "==", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 10, "role": "DATA", "label": null}], "proj": null}, - {"id": 12, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 11, "role": "DATA", "label": null}], "proj": null}, {"id": 19, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 20, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 19, "role": "DATA", "label": null}], "proj": null}, - {"id": 31, "label": "Region", "type": null, "kind": "REGION", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 5, "role": "CTRL", "label": null}, {"idx": 2, "def": 6, "role": "CTRL", "label": null}], "proj": null}, - {"id": 37, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 31, "role": "ASSOC", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, + {"id": 37, "label": "φ_b", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 20, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, {"id": 42, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 37, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, {"id": 46, "label": "#4", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 48, "label": "#5", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 49, "label": "φ_ab", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 31, "role": "ASSOC", "label": null}, {"idx": 1, "def": 46, "role": "DATA", "label": null}, {"idx": 2, "def": 48, "role": "DATA", "label": null}], "proj": null}, + {"id": 49, "label": "φ_ab", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 46, "role": "DATA", "label": null}, {"idx": 2, "def": 48, "role": "DATA", "label": null}], "proj": null}, {"id": 50, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 42, "role": "DATA", "label": null}, {"idx": 2, "def": 49, "role": "DATA", "label": null}], "proj": null}, - {"id": 51, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 31, "role": "CTRL", "label": null}, {"idx": 1, "def": 50, "role": "DATA", "label": null}], "proj": null} + {"id": 51, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 50, "role": "DATA", "label": null}], "proj": null} ], "groups": [ - {"id": 12, "par": 0, "nodes": [5, 6, 11, 12, 20, 31, 37, 49]} ] } diff --git a/chapter05/docs/05-graph7.svg b/chapter05/docs/05-graph7.svg index 4ef44b41..b121e1b9 100644 --- a/chapter05/docs/05-graph7.svg +++ b/chapter05/docs/05-graph7.svg @@ -1,4 +1,4 @@ -#20[1] → #4 · DATA#20[2] → #19 · DATA#37[1] → #20 · DATA#37[2] → #4 · DATA#42[1] → #37 · DATA#42[2] → #4 · DATA#49[1] → #46 · DATA#49[2] → #48 · DATA#50[1] → #42 · DATA#50[2] → #49 · DATA#51[1] → #50 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #51 CTRL0arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #12 -Type not computed - -[0] → #12 CTRLFalse  #6/1#6 False -Projection 1 of #12 -Type not computed - -[0] → #12 CTRL#1  #10#10 #1 +[0] → #2 DATA#2  #19#19 #2 Type not computed -==  #11#11 == +*  #20#20 * Type not computed [0] → — DATA [1] → #4 DATA -[2] → #10 DATA012If  #12#12 If -Type not computed - -[0] → #1 CTRL -[1] → #11 DATA01#2  #19#19 #2 -Type not computed - -*  #20#20 * -Type not computed - -[0] → — DATA -[1] → #4 DATA -[2] → #19 DATA012Region  #31#31 Region -Type not computed - -[0] → — DATA -[1] → #5 CTRL -[2] → #6 CTRL012φ_b  #37#37 φ_b +[2] → #19 DATA012φ_b  #37#37 φ_b Type not computed -[0] → #31 ASSOC +[0] → — ASSOC [1] → #20 DATA -[2] → #4 DATA[0] → #31012+  #42#42 + +[2] → #4 DATA012+  #42#42 + Type not computed [0] → — DATA [1] → #37 DATA -[2] → #4 DATA012#4  #46#46 #4 +[2] → #4 DATA012#4  #46#46 #4 Type not computed -#5  #48#48 #5 +#5  #48#48 #5 Type not computed -φ_ab  #49#49 φ_ab +φ_ab  #49#49 φ_ab Type not computed -[0] → #31 ASSOC +[0] → — ASSOC [1] → #46 DATA -[2] → #48 DATA[0] → #31012+  #50#50 + +[2] → #48 DATA012+  #50#50 + Type not computed [0] → — DATA [1] → #42 DATA -[2] → #49 DATA012Return  #51#51 Return +[2] → #49 DATA012Return  #51#51 Return Type not computed -[0] → #31 CTRL -[1] → #50 DATA01If  #12If · 8 nodes−Fold region +[0] → — CTRL +[1] → #50 DATA01 diff --git a/chapter05/docs/05-graph8.svg b/chapter05/docs/05-graph8.svg index bf0f8aa0..b1b4da5c 100644 --- a/chapter05/docs/05-graph8.svg +++ b/chapter05/docs/05-graph8.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - #1[1] → #6 · ASSOC · 0: arg#1[2] → #34 · ASSOC · 1: a#3[0] → #35 · CTRL#8[1] → #6 · DATA#8[2] → #7 · DATA#9[0] → #5 · CTRL#9[1] → #8 · DATA#14[1] → #6 · DATA#14[2] → #13 · DATA#15[0] → #10 · CTRL#15[1] → #14 · DATA#21[1] → #12 · CTRL#21[2] → #16 · CTRL#22[1] → #19 · DATA#22[2] → #20 · DATA#24[1] → #6 · DATA#24[2] → #23 · DATA#25[0] → #11 · CTRL#25[1] → #24 · DATA#31[1] → #17 · CTRL#31[2] → #18 · CTRL#32[1] → #29 · DATA#32[2] → #30 · DATA#33[1] → #21 · CTRL#33[2] → #31 · CTRL#34[1] → #22 · DATA#34[2] → #32 · DATA#35[0] → #33 · CTRL#35[1] → #34 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(61,193)"><rect class="region-box" rx="8" width="826" height="808" fill="#f2f7ef"/></g><g class="region" transform="translate(73,506)"><rect class="region-box" rx="8" width="410" height="374" fill="#f2f7ef"/></g><g class="region" transform="translate(515,511.7142857142857)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i1" d="M356,115 C356,139 1494.5,0 1494.5,24" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[1] → #6 · ASSOC · 0: arg#1[2] → #34 · ASSOC · 1: a#3[0] → #35 · CTRL#8[1] → #6 · DATA#8[2] → #7 · DATA#9[0] → #5 · CTRL#9[1] → #8 · DATA#14[1] → #6 · DATA#14[2] → #13 · DATA#15[0] → #10 · CTRL#15[1] → #14 · DATA#21[1] → #12 · CTRL#21[2] → #16 · CTRL#22[1] → #19 · DATA#22[2] → #20 · DATA#24[1] → #6 · DATA#24[2] → #23 · DATA#25[0] → #11 · CTRL#25[1] → #24 · DATA#31[1] → #17 · CTRL#31[2] → #18 · CTRL#32[1] → #29 · DATA#32[2] → #30 · DATA#33[1] → #21 · CTRL#33[2] → #31 · CTRL#34[1] → #22 · DATA#34[2] → #32 · DATA#35[0] → #33 · CTRL#35[1] → #34 · DATAScope  #1#1 Scope Type not computed [0] → — ASSOC 0: $ctrl diff --git a/chapter05/docs/05-graph9.svg b/chapter05/docs/05-graph9.svg index cc52c5bd..d0f62b69 100644 --- a/chapter05/docs/05-graph9.svg +++ b/chapter05/docs/05-graph9.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,633 C180,657 391,660 391,684" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #20 · CTRL#9[1] → #4 · DATA#9[2] → #8 · DATA#10[0] → #1 · CTRL#10[1] → #9 · DATA#17[1] → #5 · CTRL#17[2] → #6 · CTRL#18[1] → #14 · DATA#18[2] → #16 · DATA#20[0] → #17 · CTRL#20[1] → #18 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="360" height="354" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,633 C180,657 391,660 391,684" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #20 · CTRL#9[1] → #4 · DATA#9[2] → #8 · DATA#10[0] → #1 · CTRL#10[1] → #9 · DATA#17[1] → #5 · CTRL#17[2] → #6 · CTRL#18[1] → #14 · DATA#18[2] → #16 · DATA#20[0] → #17 · CTRL#20[1] → #18 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter06/docs/06-graph1-post.svg b/chapter06/docs/06-graph1-post.svg index faef1501..7c58b6c3 100644 --- a/chapter06/docs/06-graph1-post.svg +++ b/chapter06/docs/06-graph1-post.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #13 · CTRL#13[0] → #1 · CTRL#13[1] → #12 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #13 · CTRL#13[0] → #1 · CTRL#13[1] → #12 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter06/docs/06-graph1-pre.svg b/chapter06/docs/06-graph1-pre.svg index 2ba929f8..693ddba6 100644 --- a/chapter06/docs/06-graph1-pre.svg +++ b/chapter06/docs/06-graph1-pre.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M256,367 C256,391 287,498 287,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #12 · CTRL#3[1] → #16 · CTRL#7[0] → #1 · CTRL#7[1] → #6 · DATA#12[0] → #4 · CTRL#12[1] → #11 · DATA#14[1] → #13 · DATA#14[2] → #5 · CTRL#16[0] → #14 · CTRL#16[1] → #15 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M256,367 C256,391 287,498 287,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #12 · CTRL#3[1] → #16 · CTRL#7[0] → #1 · CTRL#7[1] → #6 · DATA#12[0] → #4 · CTRL#12[1] → #11 · DATA#14[1] → #13 · DATA#14[2] → #5 · CTRL#16[0] → #14 · CTRL#16[1] → #15 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter06/docs/06-graph2-post.svg b/chapter06/docs/06-graph2-post.svg index db95f198..a87af3ec 100644 --- a/chapter06/docs/06-graph2-post.svg +++ b/chapter06/docs/06-graph2-post.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #17 · CTRL#17[0] → #1 · CTRL#17[1] → #13 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,219 C104,243 163,246 163,270" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #17 · CTRL#17[0] → #1 · CTRL#17[1] → #13 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter06/docs/06-graph2-pre.svg b/chapter06/docs/06-graph2-pre.svg index bbc372f3..f787b4dc 100644 --- a/chapter06/docs/06-graph2-pre.svg +++ b/chapter06/docs/06-graph2-pre.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,527 C180,551 331,554 331,578" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #16 · CTRL#8[0] → #1 · CTRL#8[1] → #7 · DATA#14[1] → #4 · CTRL#14[2] → #5 · CTRL#15[1] → #12 · DATA#15[2] → #13 · DATA#16[0] → #14 · CTRL#16[1] → #15 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,527 C180,551 331,554 331,578" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #16 · CTRL#8[0] → #1 · CTRL#8[1] → #7 · DATA#14[1] → #4 · CTRL#14[2] → #5 · CTRL#15[1] → #12 · DATA#15[2] → #13 · DATA#16[0] → #14 · CTRL#16[1] → #15 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter06/docs/06-graph3-nonconst-peephole.svg b/chapter06/docs/06-graph3-nonconst-peephole.svg index 85728510..a60d66f9 100644 --- a/chapter06/docs/06-graph3-nonconst-peephole.svg +++ b/chapter06/docs/06-graph3-nonconst-peephole.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,527 C180,551 315,554 315,578" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #31 · CTRL#8[0] → #1 · CTRL#8[1] → #4 · DATA#22[1] → #5 · CTRL#22[2] → #6 · CTRL#30[1] → #27 · DATA#30[2] → #29 · DATA#31[0] → #22 · CTRL#31[1] → #30 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M180,527 C180,551 315,554 315,578" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #31 · CTRL#8[0] → #1 · CTRL#8[1] → #4 · DATA#22[1] → #5 · CTRL#22[2] → #6 · CTRL#30[1] → #27 · DATA#30[2] → #29 · DATA#31[0] → #22 · CTRL#31[1] → #30 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter06/docs/06-graph3-nonconst.svg b/chapter06/docs/06-graph3-nonconst.svg index d46d4bb1..2e4ec0fc 100644 --- a/chapter06/docs/06-graph3-nonconst.svg +++ b/chapter06/docs/06-graph3-nonconst.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="608" height="664" fill="#f2f7ef"/></g><g class="region" transform="translate(227,358)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M206,941 C206,965 543,968 543,992" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #25 · CTRL#8[0] → #1 · CTRL#8[1] → #4 · DATA#13[0] → #5 · CTRL#13[1] → #4 · DATA#19[1] → #10 · CTRL#19[2] → #11 · CTRL#20[1] → #17 · DATA#20[2] → #18 · DATA#21[1] → #19 · CTRL#21[2] → #9 · CTRL#22[1] → #12 · DATA#22[2] → #6 · DATA#23[1] → #20 · DATA#23[2] → #7 · DATA#24[1] → #23 · DATA#24[2] → #22 · DATA#25[0] → #21 · CTRL#25[1] → #24 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="608" height="664" fill="#f2f7ef"/></g><g class="region" transform="translate(227,358)"><rect class="region-box" rx="8" width="360" height="250" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M206,941 C206,965 543,968 543,992" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #25 · CTRL#8[0] → #1 · CTRL#8[1] → #4 · DATA#13[0] → #5 · CTRL#13[1] → #4 · DATA#19[1] → #10 · CTRL#19[2] → #11 · CTRL#20[1] → #17 · DATA#20[2] → #18 · DATA#21[1] → #19 · CTRL#21[2] → #9 · CTRL#22[1] → #12 · DATA#22[2] → #6 · DATA#23[1] → #20 · DATA#23[2] → #7 · DATA#24[1] → #23 · DATA#24[2] → #22 · DATA#25[0] → #21 · CTRL#25[1] → #24 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter07/docs/07-graph1.svg b/chapter07/docs/07-graph1.svg index e6ee94a4..d5de1351 100644 --- a/chapter07/docs/07-graph1.svg +++ b/chapter07/docs/07-graph1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(32,171)"><rect class="region-box" rx="8" width="296" height="102" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M84,527 C84,551 735.5,524 735.5,548" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #18 · ASSOC · 3: $ctrl#1[1] → #16 · ASSOC · 3: arg#5[0] → #6 · ASSOC · 2: $ctrl#5[1] → #8 · ASSOC · 2: arg#6[1] → #14 · CTRL#8[1] → #17 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#12[0] → #19 · ASSOC · 2: $ctrl#12[1] → #8 · ASSOC · 2: arg#16[1] → #8 · DATA#16[2] → #15 · DATAScope  #1#1 Scope + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(32,171)"><rect class="region-box" rx="8" width="296" height="102" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge ASSOC" id="e1i0" d="M84,527 C84,551 735.5,524 735.5,548" stroke="#9396a3" marker-start="url(#arrow-ASSOC)" style="opacity: 1;"><title>#1[0] → #18 · ASSOC · 3: $ctrl#1[1] → #16 · ASSOC · 3: arg#5[0] → #6 · ASSOC · 2: $ctrl#5[1] → #8 · ASSOC · 2: arg#6[1] → #14 · CTRL#8[1] → #17 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#12[0] → #19 · ASSOC · 2: $ctrl#12[1] → #8 · ASSOC · 2: arg#16[1] → #8 · DATA#16[2] → #15 · DATAScope  #1#1 Scope Type not computed [0] → #18 ASSOC 3: $ctrl diff --git a/chapter07/docs/07-graph2.svg b/chapter07/docs/07-graph2.svg index 72153555..d2488859 100644 --- a/chapter07/docs/07-graph2.svg +++ b/chapter07/docs/07-graph2.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="637" height="410" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M246,687 C246,711 420.5,714 420.5,738" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #17 · CTRL#6[1] → #1 · CTRL#6[2] → #5 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#17[0] → #7 · CTRL#17[1] → #8 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,171)"><rect class="region-box" rx="8" width="637" height="410" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M246,687 C246,711 420.5,714 420.5,738" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #17 · CTRL#6[1] → #1 · CTRL#6[2] → #5 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#17[0] → #7 · CTRL#17[1] → #8 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter07/docs/07-graph3.svg b/chapter07/docs/07-graph3.svg index 181b72a9..e8ca3ba5 100644 --- a/chapter07/docs/07-graph3.svg +++ b/chapter07/docs/07-graph3.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(72,171)"><rect class="region-box" rx="8" width="1092" height="954" fill="#f1f6fc"/></g><g class="region" transform="translate(116,640)"><rect class="region-box" rx="8" width="666" height="438" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M812,1231 C812,1255 667,1258 667,1282" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #35 · CTRL#8[1] → #1 · CTRL#8[2] → #15 · CTRL#11[1] → #6 · DATA#11[2] → #24 · DATA#12[1] → #7 · DATA#12[2] → #19 · DATA#13[1] → #12 · DATA#13[2] → #4 · DATA#14[0] → #8 · CTRL#14[1] → #13 · DATA#19[1] → #12 · DATA#19[2] → #18 · DATA#21[1] → #5 · CTRL#21[2] → #10 · CTRL#24[1] → #11 · DATA#24[2] → #32 · DATA#26[1] → #20 · DATA#26[2] → #34 · DATA#27[1] → #26 · DATA#27[2] → #4 · DATA#28[0] → #21 · CTRL#28[1] → #27 · DATA#32[1] → #26 · DATA#32[2] → #24 · DATA#34[1] → #26 · DATA#34[2] → #33 · DATA#35[0] → #9 · CTRL#35[1] → #11 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(72,171)"><rect class="region-box" rx="8" width="1092" height="954" fill="#f1f6fc"/></g><g class="region" transform="translate(116,640)"><rect class="region-box" rx="8" width="666" height="438" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M812,1231 C812,1255 667,1258 667,1282" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #35 · CTRL#8[1] → #1 · CTRL#8[2] → #15 · CTRL#11[1] → #6 · DATA#11[2] → #24 · DATA#12[1] → #7 · DATA#12[2] → #19 · DATA#13[1] → #12 · DATA#13[2] → #4 · DATA#14[0] → #8 · CTRL#14[1] → #13 · DATA#19[1] → #12 · DATA#19[2] → #18 · DATA#21[1] → #5 · CTRL#21[2] → #10 · CTRL#24[1] → #11 · DATA#24[2] → #32 · DATA#26[1] → #20 · DATA#26[2] → #34 · DATA#27[1] → #26 · DATA#27[2] → #4 · DATA#28[0] → #21 · CTRL#28[1] → #27 · DATA#32[1] → #26 · DATA#32[2] → #24 · DATA#34[1] → #26 · DATA#34[2] → #33 · DATA#35[0] → #9 · CTRL#35[1] → #11 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter07/docs/07-graph4.svg b/chapter07/docs/07-graph4.svg index 0fc498f7..09cea0b4 100644 --- a/chapter07/docs/07-graph4.svg +++ b/chapter07/docs/07-graph4.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="813" height="890" fill="#f1f6fc"/></g><g class="region" transform="translate(271,632)"><rect class="region-box" rx="8" width="512" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M269,1169 C269,1193 575.5,1196 575.5,1220" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #30 · CTRL#8[1] → #1 · CTRL#8[2] → #27 · CTRL#11[1] → #6 · DATA#11[2] → #28 · DATA#12[1] → #7 · DATA#12[2] → #29 · DATA#14[1] → #11 · DATA#14[2] → #13 · DATA#15[0] → #8 · CTRL#15[1] → #14 · DATA#20[1] → #11 · DATA#20[2] → #19 · DATA#21[0] → #4 · CTRL#21[1] → #20 · DATA#27[1] → #9 · CTRL#27[2] → #10 · CTRL#28[1] → #25 · DATA#28[2] → #11 · DATA#29[1] → #12 · DATA#29[2] → #26 · DATA#30[0] → #5 · CTRL#30[1] → #12 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(24,173)"><rect class="region-box" rx="8" width="813" height="890" fill="#f1f6fc"/></g><g class="region" transform="translate(271,632)"><rect class="region-box" rx="8" width="512" height="374" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M269,1169 C269,1193 575.5,1196 575.5,1220" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #30 · CTRL#8[1] → #1 · CTRL#8[2] → #27 · CTRL#11[1] → #6 · DATA#11[2] → #28 · DATA#12[1] → #7 · DATA#12[2] → #29 · DATA#14[1] → #11 · DATA#14[2] → #13 · DATA#15[0] → #8 · CTRL#15[1] → #14 · DATA#20[1] → #11 · DATA#20[2] → #19 · DATA#21[0] → #4 · CTRL#21[1] → #20 · DATA#27[1] → #9 · CTRL#27[2] → #10 · CTRL#28[1] → #25 · DATA#28[2] → #11 · DATA#29[1] → #12 · DATA#29[2] → #26 · DATA#30[0] → #5 · CTRL#30[1] → #12 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter08/docs/08-graph1.svg b/chapter08/docs/08-graph1.svg index 67630205..c398607a 100644 --- a/chapter08/docs/08-graph1.svg +++ b/chapter08/docs/08-graph1.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(34,269)"><rect class="region-box" rx="8" width="667" height="810" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M409,1289 C409,1313 483,1316 483,1340" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #40 · CTRL#6[1] → #1 · CTRL#6[2] → #39 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#18[1] → #16 · DATA#18[2] → #17 · DATA#19[0] → #5 · CTRL#19[1] → #18 · DATA#27[1] → #16 · DATA#27[2] → #26 · DATA#28[0] → #13 · CTRL#28[1] → #27 · DATA#34[1] → #7 · CTRL#34[2] → #14 · CTRL#35[1] → #8 · DATA#35[2] → #16 · DATA#39[1] → #12 · CTRL#39[2] → #20 · CTRL#40[0] → #34 · CTRL#40[1] → #35 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(34,269)"><rect class="region-box" rx="8" width="667" height="810" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M409,1289 C409,1313 483,1316 483,1340" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #40 · CTRL#6[1] → #1 · CTRL#6[2] → #39 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#18[1] → #16 · DATA#18[2] → #17 · DATA#19[0] → #5 · CTRL#19[1] → #18 · DATA#27[1] → #16 · DATA#27[2] → #26 · DATA#28[0] → #13 · CTRL#28[1] → #27 · DATA#34[1] → #7 · CTRL#34[2] → #14 · CTRL#35[1] → #8 · DATA#35[2] → #16 · DATA#39[1] → #12 · CTRL#39[2] → #20 · CTRL#40[0] → #34 · CTRL#40[1] → #35 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter08/docs/08-graph2.svg b/chapter08/docs/08-graph2.svg index be8bd367..e3d62fb9 100644 --- a/chapter08/docs/08-graph2.svg +++ b/chapter08/docs/08-graph2.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(133,171)"><rect class="region-box" rx="8" width="691" height="1074" fill="#f1f6fc"/></g><g class="region" transform="translate(347,602)"><rect class="region-box" rx="8" width="422" height="606" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M356,1351 C356,1375 451,1378 451,1402" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #39 · CTRL#6[1] → #1 · CTRL#6[2] → #38 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#18[1] → #16 · DATA#18[2] → #17 · DATA#19[0] → #5 · CTRL#19[1] → #18 · DATA#27[1] → #16 · DATA#27[2] → #26 · DATA#28[0] → #13 · CTRL#28[1] → #27 · DATA#34[1] → #12 · CTRL#34[2] → #14 · CTRL#38[1] → #34 · CTRL#38[2] → #20 · CTRL#39[0] → #7 · CTRL#39[1] → #8 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(133,171)"><rect class="region-box" rx="8" width="691" height="1074" fill="#f1f6fc"/></g><g class="region" transform="translate(347,602)"><rect class="region-box" rx="8" width="422" height="606" fill="#f2f7ef"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M356,1351 C356,1375 451,1378 451,1402" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #39 · CTRL#6[1] → #1 · CTRL#6[2] → #38 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#18[1] → #16 · DATA#18[2] → #17 · DATA#19[0] → #5 · CTRL#19[1] → #18 · DATA#27[1] → #16 · DATA#27[2] → #26 · DATA#28[0] → #13 · CTRL#28[1] → #27 · DATA#34[1] → #12 · CTRL#34[2] → #14 · CTRL#38[1] → #34 · CTRL#38[2] → #20 · CTRL#39[0] → #7 · CTRL#39[1] → #8 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter08/docs/08-graph3.svg b/chapter08/docs/08-graph3.svg index d2c78bc5..62517032 100644 --- a/chapter08/docs/08-graph3.svg +++ b/chapter08/docs/08-graph3.svg @@ -60,7 +60,7 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(34,269)"><rect class="region-box" rx="8" width="667" height="706" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M449,1289 C449,1313 477.5,1316 477.5,1340" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #39 · CTRL#6[1] → #1 · CTRL#6[2] → #20 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#18[1] → #16 · DATA#18[2] → #17 · DATA#19[0] → #5 · CTRL#19[1] → #18 · DATA#25[1] → #7 · CTRL#25[2] → #12 · CTRL#26[1] → #8 · DATA#26[2] → #16 · DATA#29[1] → #16 · DATA#29[2] → #28 · DATA#30[0] → #13 · CTRL#30[1] → #29 · DATA#36[1] → #25 · CTRL#36[2] → #14 · CTRL#37[1] → #26 · DATA#37[2] → #16 · DATA#39[0] → #36 · CTRL#39[1] → #37 · DATA$ctrl  #1/0#1 $ctrl + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"><g class="region" transform="translate(34,269)"><rect class="region-box" rx="8" width="667" height="706" fill="#f1f6fc"/></g></g><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M449,1289 C449,1313 477.5,1316 477.5,1340" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #39 · CTRL#6[1] → #1 · CTRL#6[2] → #20 · CTRL#8[1] → #4 · DATA#8[2] → #16 · DATA#10[1] → #8 · DATA#10[2] → #9 · DATA#11[0] → #6 · CTRL#11[1] → #10 · DATA#16[1] → #8 · DATA#16[2] → #15 · DATA#18[1] → #16 · DATA#18[2] → #17 · DATA#19[0] → #5 · CTRL#19[1] → #18 · DATA#25[1] → #7 · CTRL#25[2] → #12 · CTRL#26[1] → #8 · DATA#26[2] → #16 · DATA#29[1] → #16 · DATA#29[2] → #28 · DATA#30[0] → #13 · CTRL#30[1] → #29 · DATA#36[1] → #25 · CTRL#36[2] → #14 · CTRL#37[1] → #26 · DATA#37[2] → #16 · DATA#39[0] → #36 · CTRL#39[1] → #37 · DATA$ctrl  #1/0#1 $ctrl Projection 0 of #2 Type not computed diff --git a/chapter09/README.md b/chapter09/README.md index 9c9eba07..5aa74a3b 100644 --- a/chapter09/README.md +++ b/chapter09/README.md @@ -187,6 +187,10 @@ Changes: ## Common SubExpressions via GVN +These diagrams focus on value dependencies. Routine control flow is omitted; +small True/False projections distinguish the two Returns in the first example. +Empty control slots can stand for omitted context, not missing compiler inputs. + ### Example 1 Here is a small example that illustrates how GVN enables finding common sub-expressions. @@ -245,6 +249,10 @@ return arg; While parsing the `while` loop it is not yet known that `step` is a constant and will not change. Therefore, without the post parse optimization we get the following: +The loop test and control backedge are omitted in both diagrams. The Phi's +data backedge remains, making the repeated additions and their replacement +easy to compare; its input 1 is the entry value and input 2 the next iteration. + ![Graph5](./docs/09-graph5.svg) Enabling the post parse worklist based optimization yields below. Notice that now the graph shows `arg+2` inside the diff --git a/chapter09/docs/09-graph1.json b/chapter09/docs/09-graph1.json index 746d4de2..8dfdee0a 100644 --- a/chapter09/docs/09-graph1.json +++ b/chapter09/docs/09-graph1.json @@ -2,20 +2,15 @@ "ver": 1, "comp": "chapter09/docs/09-graph1.svg", "step": 1, - "roots": [], + "roots": [18, 24], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}, {"idx": 1, "def": 24, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, - {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 1}}, {"id": 7, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 8, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, - {"id": 9, "label": "10", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, - {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, {"id": 16, "label": "2", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 17, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 16, "role": "DATA", "label": null}], "proj": null}, {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 17, "role": "DATA", "label": null}], "proj": null}, diff --git a/chapter09/docs/09-graph1.svg b/chapter09/docs/09-graph1.svg index e639b36b..1b53a14a 100644 --- a/chapter09/docs/09-graph1.svg +++ b/chapter09/docs/09-graph1.svg @@ -1,4 +1,4 @@ -<svg aria-label="Compiler graph" width="847" height="572" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 847 572" style="font-family: sans-serif;"><style> +<svg aria-label="Compiler graph" width="587" height="454" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 587 454" style="font-family: sans-serif;"><style> html, body { height:100%; margin:0; font-family:sans-serif; } .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } .source { padding:8px; border-bottom:1px solid #ccc; } @@ -60,70 +60,50 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M236,471 C236,495 411.5,498 411.5,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #18 · CTRL#3[1] → #24 · CTRL#8[1] → #4 · DATA#8[2] → #7 · DATA#10[1] → #4 · DATA#10[2] → #9 · DATA#11[0] → #1 · CTRL#11[1] → #10 · DATA#17[1] → #4 · DATA#17[2] → #16 · DATA#18[0] → #5 · CTRL#18[1] → #17 · DATA#21[1] → #8 · DATA#21[2] → #20 · DATA#24[0] → #6 · CTRL#24[1] → #21 · DATA$ctrl  #1/0#1 $ctrl -Projection 0 of #2 + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge DATA" id="e8i1" d="M193,118 L193,130 Q193,138 201,138 L337,138 Q345,138 345,146 L345,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA#8[2] → #7 · DATA#17[1] → #4 · DATA#17[2] → #16 · DATA#18[0] → #5 · CTRL#18[1] → #17 · DATA#21[1] → #8 · DATA#21[2] → #20 · DATA#24[0] → #6 · CTRL#24[1] → #21 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #18 CTRL -[1] → #24 CTRL01arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #11 -Type not computed - -[0] → #11 CTRLFalse  #6/1#6 False -Projection 1 of #11 +[0] → #2 DATATrue  #5/0#5 True +Projection 0 of #0 Type not computed -[0] → #11 CTRL2  #7#7 2 +False  #6/1#6 False +Projection 1 of #0 Type not computed -*  #8#8 * +2  #7#7 2 Type not computed -[0] → — DATA -[1] → #4 DATA -[2] → #7 DATA01210  #9#9 10 -Type not computed - -<  #10#10 < +*  #8#8 * Type not computed [0] → — DATA [1] → #4 DATA -[2] → #9 DATA012If  #11#11 If -Type not computed - -[0] → #1 CTRL -[1] → #10 DATA012  #16#16 2 +[2] → #7 DATA0122  #16#16 2 Type not computed -*  #17#17 * +*  #17#17 * Type not computed [0] → — DATA [1] → #4 DATA -[2] → #16 DATA012Return  #18#18 Return +[2] → #16 DATA012Return  #18#18 Return Type not computed [0] → #5 CTRL -[1] → #17 DATA011  #20#20 1 +[1] → #17 DATA011  #20#20 1 Type not computed -+  #21#21 + ++  #21#21 + Type not computed [0] → — DATA [1] → #8 DATA -[2] → #20 DATA012Return  #24#24 Return +[2] → #20 DATA012Return  #24#24 Return Type not computed [0] → #6 CTRL diff --git a/chapter09/docs/09-graph2.json b/chapter09/docs/09-graph2.json index 5b449041..7b48931f 100644 --- a/chapter09/docs/09-graph2.json +++ b/chapter09/docs/09-graph2.json @@ -2,20 +2,15 @@ "ver": 1, "comp": "chapter09/docs/09-graph2.svg", "step": 1, - "roots": [], + "roots": [18, 24], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 18, "role": "CTRL", "label": null}, {"idx": 1, "def": 24, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 0}}, - {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 11, "role": "CTRL", "label": null}], "proj": {"par": 11, "idx": 1}}, + {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 0}}, + {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [], "proj": {"par": 0, "idx": 1}}, {"id": 7, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 8, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, - {"id": 9, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 10, "role": "DATA", "label": null}], "proj": null}, - {"id": 10, "label": "#10", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 11, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, {"id": 18, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 5, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null}, {"id": 20, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}, {"idx": 2, "def": 21, "role": "DATA", "label": null}], "proj": null}, {"id": 21, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, diff --git a/chapter09/docs/09-graph2.svg b/chapter09/docs/09-graph2.svg index a2484f5c..59ef5de1 100644 --- a/chapter09/docs/09-graph2.svg +++ b/chapter09/docs/09-graph2.svg @@ -1,4 +1,4 @@ -<svg aria-label="Compiler graph" width="618" height="572" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 618 572" style="font-family: sans-serif;"><style> +<svg aria-label="Compiler graph" width="548" height="454" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 548 454" style="font-family: sans-serif;"><style> html, body { height:100%; margin:0; font-family:sans-serif; } .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } .source { padding:8px; border-bottom:1px solid #ccc; } @@ -60,62 +60,42 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,471 C104,495 297,498 297,522" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #18 · CTRL#3[1] → #24 · CTRL#8[1] → #4 · DATA#8[2] → #7 · DATA#9[1] → #4 · DATA#9[2] → #10 · DATA#11[0] → #1 · CTRL#11[1] → #9 · DATA#18[0] → #5 · CTRL#18[1] → #8 · DATA#20[1] → #8 · DATA#20[2] → #21 · DATA#24[0] → #6 · CTRL#24[1] → #20 · DATA$ctrl  #1/0#1 $ctrl -Projection 0 of #2 + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge DATA" id="e8i1" d="M306,118 L306,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#8[1] → #4 · DATA#8[2] → #7 · DATA#18[0] → #5 · CTRL#18[1] → #8 · DATA#20[1] → #8 · DATA#20[2] → #21 · DATA#24[0] → #6 · CTRL#24[1] → #20 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #18 CTRL -[1] → #24 CTRL01arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #11 -Type not computed - -[0] → #11 CTRLFalse  #6/1#6 False -Projection 1 of #11 +[0] → #2 DATATrue  #5/0#5 True +Projection 0 of #0 Type not computed -[0] → #11 CTRL#2  #7#7 #2 +False  #6/1#6 False +Projection 1 of #0 Type not computed -*  #8#8 * +#2  #7#7 #2 Type not computed -[0] → — DATA -[1] → #4 DATA -[2] → #7 DATA012<  #9#9 < +*  #8#8 * Type not computed [0] → — DATA [1] → #4 DATA -[2] → #10 DATA012#10  #10#10 #10 -Type not computed - -If  #11#11 If -Type not computed - -[0] → #1 CTRL -[1] → #9 DATA01Return  #18#18 Return +[2] → #7 DATA012Return  #18#18 Return Type not computed [0] → #5 CTRL -[1] → #8 DATA01+  #20#20 + +[1] → #8 DATA01+  #20#20 + Type not computed [0] → — DATA [1] → #8 DATA -[2] → #21 DATA012#1  #21#21 #1 +[2] → #21 DATA012#1  #21#21 #1 Type not computed -Return  #24#24 Return +Return  #24#24 Return Type not computed [0] → #6 CTRL diff --git a/chapter09/docs/09-graph3.json b/chapter09/docs/09-graph3.json index 57546e51..abdb81b6 100644 --- a/chapter09/docs/09-graph3.json +++ b/chapter09/docs/09-graph3.json @@ -2,17 +2,15 @@ "ver": 1, "comp": "chapter09/docs/09-graph3.svg", "step": 1, - "roots": [], + "roots": [9], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 9, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, {"id": 6, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, {"id": 7, "label": "*", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 4, "role": "DATA", "label": null}], "proj": null}, {"id": 8, "label": "-", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 7, "role": "DATA", "label": null}], "proj": null}, - {"id": 9, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null} + {"id": 9, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 8, "role": "DATA", "label": null}], "proj": null} ], "groups": [ ] diff --git a/chapter09/docs/09-graph3.svg b/chapter09/docs/09-graph3.svg index 51804b59..da89b9b9 100644 --- a/chapter09/docs/09-graph3.svg +++ b/chapter09/docs/09-graph3.svg @@ -1,4 +1,4 @@ -<svg aria-label="Compiler graph" width="391" height="528" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 391 528" style="font-family: sans-serif;"><style> +<svg aria-label="Compiler graph" width="340" height="454" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 340 454" style="font-family: sans-serif;"><style> html, body { height:100%; margin:0; font-family:sans-serif; } .viewer { height:100%; display:grid; grid-template-rows:auto minmax(0,1fr) auto; } .source { padding:8px; border-bottom:1px solid #ccc; } @@ -60,37 +60,30 @@ .count { font-size:20px; min-width:35px; text-align:center; } #N { width:6ch; } #scrub { width:clamp(120px,35vw,600px); } - </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge CTRL" id="e3i0" d="M104,427 C104,451 195.5,454 195.5,478" stroke="#b63838" marker-start="url(#arrow-CTRL)" style="opacity: 1;"><title>#3[0] → #9 · CTRL#6[1] → #4 · DATA#6[2] → #4 · DATA#7[1] → #4 · DATA#7[2] → #4 · DATA#8[1] → #6 · DATA#8[2] → #7 · DATA#9[0] → #1 · CTRL#9[1] → #8 · DATA$ctrl  #1/0#1 $ctrl -Projection 0 of #2 + </style><defs><marker id="arrow-CTRL" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#b63838"/></marker><marker id="arrow-DATA" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#536477"/></marker><marker id="arrow-MEM" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#2867b2"/></marker><marker id="arrow-ASSOC" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#9396a3"/></marker><marker id="arrow-PARSER" viewBox="0 -4 8 8" refX="8" refY="0" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,-4L8,0L0,4Z" fill="#7956a5"/></marker></defs><rect width="100%" height="100%" fill="rgb(250, 251, 252)"/><g><g class="regions" style="opacity: 1;"/><rect class="peep-area" rx="36" style="opacity: 0;"/><g class="edges"><path class="edge DATA" id="e6i1" d="M134,118 L134,123 Q134,128 129,128 L112,128 Q104,128 104,136 L104,166" stroke="#536477" marker-start="url(#arrow-DATA)" style="opacity: 1;"><title>#6[1] → #4 · DATA#6[2] → #4 · DATA#7[1] → #4 · DATA#7[2] → #4 · DATA#8[1] → #6 · DATA#8[2] → #7 · DATA#9[1] → #8 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #9 CTRL0arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATA*  #6#6 * +[0] → #2 DATA*  #6#6 * Type not computed [0] → — DATA [1] → #4 DATA -[2] → #4 DATA012*  #7#7 * +[2] → #4 DATA012*  #7#7 * Type not computed [0] → — DATA [1] → #4 DATA -[2] → #4 DATA012-  #8#8 - +[2] → #4 DATA012-  #8#8 - Type not computed [0] → — DATA [1] → #6 DATA -[2] → #7 DATA012Return  #9#9 Return +[2] → #7 DATA012Return  #9#9 Return Type not computed -[0] → #1 CTRL -[1] → #8 DATA01 +[0] → — CTRL +[1] → #8 DATA01 diff --git a/chapter09/docs/09-graph4.json b/chapter09/docs/09-graph4.json index accad3ff..1282e87e 100644 --- a/chapter09/docs/09-graph4.json +++ b/chapter09/docs/09-graph4.json @@ -2,14 +2,11 @@ "ver": 1, "comp": "chapter09/docs/09-graph4.svg", "step": 1, - "roots": [], + "roots": [10], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, - {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 10, "role": "CTRL", "label": null}], "proj": null}, {"id": 9, "label": "#0", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 10, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 1, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} + {"id": 10, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} ], "groups": [ ] diff --git a/chapter09/docs/09-graph4.svg b/chapter09/docs/09-graph4.svg index 89045214..3c49a48a 100644 --- a/chapter09/docs/09-graph4.svg +++ b/chapter09/docs/09-graph4.svg @@ -1,4 +1,4 @@ -#10[1] → #9 · DATA#0  #9#9 #0 Type not computed -[0] → #2 CTRLStart  #2#2 Start +Return  #10#10 Return Type not computed -Stop  #3#3 Stop -Type not computed - -[0] → #10 CTRL0#0  #9#9 #0 -Type not computed - -Return  #10#10 Return -Type not computed - -[0] → #1 CTRL -[1] → #9 DATA01 +[0] → — CTRL +[1] → #9 DATA01 diff --git a/chapter09/docs/09-graph5.json b/chapter09/docs/09-graph5.json index 31957bfa..ff52950d 100644 --- a/chapter09/docs/09-graph5.json +++ b/chapter09/docs/09-graph5.json @@ -2,26 +2,17 @@ "ver": 1, "comp": "chapter09/docs/09-graph5.svg", "step": 1, - "roots": [], + "roots": [21], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 0}}, {"id": 6, "label": "#1", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 7, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, - {"id": 8, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 1}}, - {"id": 9, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 7, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 18, "role": "DATA", "label": null}], "proj": null}, - {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}, {"idx": 2, "def": 11, "role": "DATA", "label": null}], "proj": null}, - {"id": 11, "label": "#10", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 12, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 18, "role": "DATA", "label": null, "backedge": true}], "proj": null}, {"id": 16, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 6, "role": "DATA", "label": null}, {"idx": 2, "def": 9, "role": "DATA", "label": null}], "proj": null}, {"id": 18, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 16, "role": "DATA", "label": null}, {"idx": 2, "def": 6, "role": "DATA", "label": null}], "proj": null}, - {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 8, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null} ], "groups": [ - {"id": 7, "par": 0, "nodes": [5, 7, 8, 9, 10, 12, 16, 18]} ] } diff --git a/chapter09/docs/09-graph5.svg b/chapter09/docs/09-graph5.svg index 7457cb38..bbaf2227 100644 --- a/chapter09/docs/09-graph5.svg +++ b/chapter09/docs/09-graph5.svg @@ -1,4 +1,4 @@ -#9[1] → #4 · DATA#9[2] → #18 · DATA#16[1] → #6 · DATA#16[2] → #9 · DATA#18[1] → #16 · DATA#18[2] → #6 · DATA#21[1] → #9 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #21 CTRL0arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #12 -Type not computed - -[0] → #12 CTRL#1  #6#6 #1 -Type not computed - -Loop  #7#7 Loop -Type not computed - -[0] → — DATA -[1] → #1 CTRL -[2] → #5 CTRL012False  #8/1#8 False -Projection 1 of #12 +[0] → #2 DATA#1  #6#6 #1 Type not computed -[0] → #12 CTRLφ_arg  #9#9 φ_arg +φ_arg  #9#9 φ_arg Type not computed -[0] → #7 ASSOC +[0] → — ASSOC [1] → #4 DATA -[2] → #18 DATA[0] → #7012<  #10#10 < -Type not computed - -[0] → — DATA -[1] → #9 DATA -[2] → #11 DATA012#10  #11#11 #10 -Type not computed - -If  #12#12 If -Type not computed - -[0] → #7 CTRL -[1] → #10 DATA01+  #16#16 + +[2] → #18 DATA012+  #16#16 + Type not computed [0] → — DATA [1] → #6 DATA -[2] → #9 DATA012+  #18#18 + +[2] → #9 DATA012+  #18#18 + Type not computed [0] → — DATA [1] → #16 DATA -[2] → #6 DATA012Return  #21#21 Return +[2] → #6 DATA012Return  #21#21 Return Type not computed -[0] → #8 CTRL -[1] → #9 DATA01Loop  #7Loop · 8 nodes−Fold region +[0] → — CTRL +[1] → #9 DATA01 diff --git a/chapter09/docs/09-graph6.json b/chapter09/docs/09-graph6.json index 09fa1202..5b511bd1 100644 --- a/chapter09/docs/09-graph6.json +++ b/chapter09/docs/09-graph6.json @@ -2,25 +2,16 @@ "ver": 1, "comp": "chapter09/docs/09-graph6.svg", "step": 1, - "roots": [], + "roots": [21], "scope": 0, "nodes": [ - {"id": 1, "label": "$ctrl", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 2, "role": "CTRL", "label": null}], "proj": {"par": 2, "idx": 0}}, {"id": 2, "label": "Start", "type": null, "kind": "CTRL", "edges": [], "proj": null}, - {"id": 3, "label": "Stop", "type": null, "kind": "STOP", "edges": [{"idx": 0, "def": 21, "role": "CTRL", "label": null}], "proj": null}, {"id": 4, "label": "arg", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 2, "role": "DATA", "label": null}], "proj": {"par": 2, "idx": 1}}, - {"id": 5, "label": "True", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 0}}, - {"id": 6, "label": "False", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 12, "role": "CTRL", "label": null}], "proj": {"par": 12, "idx": 1}}, - {"id": 7, "label": "Loop", "type": null, "kind": "LOOP", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 1, "role": "CTRL", "label": null}, {"idx": 2, "def": 5, "role": "CTRL", "label": null}], "proj": null}, - {"id": 9, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 7, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 25, "role": "DATA", "label": null}], "proj": null}, - {"id": 10, "label": "<", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}, {"idx": 2, "def": 11, "role": "DATA", "label": null}], "proj": null}, - {"id": 11, "label": "#10", "type": null, "kind": "DATA", "edges": [], "proj": null}, - {"id": 12, "label": "If", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 7, "role": "CTRL", "label": null}, {"idx": 1, "def": 10, "role": "DATA", "label": null}], "proj": null}, - {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 6, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, + {"id": 9, "label": "φ_arg", "type": null, "kind": "PHI", "edges": [{"idx": 0, "def": 0, "role": "ASSOC", "label": null}, {"idx": 1, "def": 4, "role": "DATA", "label": null}, {"idx": 2, "def": 25, "role": "DATA", "label": null, "backedge": true}], "proj": null}, + {"id": 21, "label": "Return", "type": null, "kind": "CTRL", "edges": [{"idx": 0, "def": 0, "role": "CTRL", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}], "proj": null}, {"id": 24, "label": "#2", "type": null, "kind": "DATA", "edges": [], "proj": null}, {"id": 25, "label": "+", "type": null, "kind": "DATA", "edges": [{"idx": 0, "def": 0, "role": "DATA", "label": null}, {"idx": 1, "def": 9, "role": "DATA", "label": null}, {"idx": 2, "def": 24, "role": "DATA", "label": null}], "proj": null} ], "groups": [ - {"id": 7, "par": 0, "nodes": [5, 6, 7, 9, 10, 12, 25]} ] } diff --git a/chapter09/docs/09-graph6.svg b/chapter09/docs/09-graph6.svg index 2d530c46..b573d88a 100644 --- a/chapter09/docs/09-graph6.svg +++ b/chapter09/docs/09-graph6.svg @@ -1,4 +1,4 @@ -#9[1] → #4 · DATA#9[2] → #25 · DATA#21[1] → #9 · DATA#25[1] → #9 · DATA#25[2] → #24 · DATAStart  #2#2 Start Type not computed -[0] → #2 CTRLStart  #2#2 Start -Type not computed - -Stop  #3#3 Stop -Type not computed - -[0] → #21 CTRL0arg  #4/1#4 arg +arg  #4/1#4 arg Projection 1 of #2 Type not computed -[0] → #2 DATATrue  #5/0#5 True -Projection 0 of #12 -Type not computed - -[0] → #12 CTRLFalse  #6/1#6 False -Projection 1 of #12 -Type not computed - -[0] → #12 CTRLLoop  #7#7 Loop +[0] → #2 DATAφ_arg  #9#9 φ_arg Type not computed -[0] → — DATA -[1] → #1 CTRL -[2] → #5 CTRL012φ_arg  #9#9 φ_arg -Type not computed - -[0] → #7 ASSOC +[0] → — ASSOC [1] → #4 DATA -[2] → #25 DATA[0] → #7012<  #10#10 < -Type not computed - -[0] → — DATA -[1] → #9 DATA -[2] → #11 DATA012#10  #11#11 #10 -Type not computed - -If  #12#12 If -Type not computed - -[0] → #7 CTRL -[1] → #10 DATA01Return  #21#21 Return +[2] → #25 DATA012Return  #21#21 Return Type not computed -[0] → #6 CTRL -[1] → #9 DATA01#2  #24#24 #2 +[0] → — CTRL +[1] → #9 DATA01#2  #24#24 #2 Type not computed -+  #25#25 + ++  #25#25 + Type not computed [0] → — DATA [1] → #9 DATA -[2] → #24 DATA012Loop  #7Loop · 7 nodes−Fold region +[2] → #24 DATA012 diff --git a/chapter10a/README.md b/chapter10a/README.md index d6945f03..e150c664 100644 --- a/chapter10a/README.md +++ b/chapter10a/README.md @@ -8,6 +8,49 @@ stores, and null checking. It also introduces an evaluator that executes the graph, including its memory effects. The [grammar](docs/10-grammar.md) is the same in 10a and 10b; the next chapter improves the memory representation. +## References + +Structs are a collection of named and typed fields; very classically similar to +C or Java. New structs are made with the `new` keyword; this allocates memory +and produces a reference. Freeing memory awaits a later chapter. Fields are +accessed with the `.` notation. The fields can hold any scalar value, +including reference other structs and be mutually recursive. Any reference +field can allow null or not, same as a normal variable. + +```java +struct Person { + String last; // Last name, must exist + String? middle; // Optional middle name + int age; +}; +``` + +Here we have fields `last`, a not-null final String, and `middle` a nullable +and final String, and an `int age`. Like all `int` declared fields, it is +mutable. Later chapters will allow both mutable reference fields and immutable +integer fields; for now this choice covers most of the common ground. + +You have to have a reference to get at the fields, static fields are added in a later chapter. + +All field references have to be against not-null pointers, and this is directly +checked in the type system. I.e., Simple disallows null-pointer-exceptions by +design. Some examples of null checking before using: + +```java +print(ptr.age); // ERROR! ptr might be null + +if( ptr ) print(ptr.age); // Test before use + +// Field use can be far removed, as long as the check dominates +if( ptr ) { + S1; // Other statements + while( other ) { ...ptr.age... } +}; +``` + +Allocation, as well as Stores, means we now have memory effects to deal with. + + ## One memory value Arithmetic nodes depend on the values they use, similarly a load also depends diff --git a/chapter12/README.md b/chapter12/README.md index 49cc5e02..36922373 100644 --- a/chapter12/README.md +++ b/chapter12/README.md @@ -3,11 +3,6 @@ [Previous: Chapter 11](../chapter11/README.md) | [Next: Chapter 13](../chapter13/README.md) -Memory keeps Chapter 11's single `$mem` binding and lazy `MemMerge`, `MemPhi`, -and `BulkMemPhi` partitions. Start produces `{ctrl, $mem, arg}` and Return -consumes `{ctrl, $mem, result}`; floating-point arithmetic needs no new memory -representation. - # Table of Contents 1. [Float](#floats) diff --git a/chapter13/README.md b/chapter13/README.md index 38b512cc..ae1d378b 100644 --- a/chapter13/README.md +++ b/chapter13/README.md @@ -3,45 +3,41 @@ [Previous: Chapter 12](../chapter12/README.md) | [Next: Chapter 14](../chapter14/README.md) -Memory retains one `$mem` binding and lazy partitions. Typed initialization -stores now include each field's declared type and initialization flag, while -`MemMerge` preserves the other fields. Start and Return keep control in slot 0 -and memory in slot 1. - # Table of Contents 1. [References](#references) - [Forward References](#forward-references) - [Self-referential references](#self-referential-references) - [Auto deepen forward ref types](#auto-deepen-forward-ref-types) -2. [Global Code Motion Example](#global-code-motion-walkthrough) -In this chapter, we add references and structs. +In this chapter, we extend structs to allow for forward and cyclic references. You can also read [this chapter](https://github.com/SeaOfNodes/Simple/tree/linear-chapter13) in a linear Git revision history on the [linear](https://github.com/SeaOfNodes/Simple/tree/linear) branch and [compare](https://github.com/SeaOfNodes/Simple/compare/linear-chapter12...linear-chapter13) it to the previous chapter. -## References - -Structs can reference other structs; references can be mutually recursive. -Any reference field can allow null or not, same as a normal variable. - -### Forward References -A forward reference occurs when a type or identifier is used before its full definition is -encountered by the compiler. (incomplete types, mutual references). -When forward-reference types are encountered, the compiler may initially treat them as placeholders or "shallow" representations. +## Forward References +A forward reference occurs when a type or identifier is used before its full +definition is encountered by the compiler. (incomplete types, mutual +references). When forward-reference types are encountered, the compiler may +initially treat them as placeholders or "shallow" representations. -Consider the following code: ```java struct Person { -String name; // No string type, yet -int age; -FamilyTree? tree; // A family tree, or not + String name; // No string type, yet + int age; + FamilyTree? tree; // A family tree, or not } -... ``` -At the time of the `Person` struct definition, the `FamilyTree` struct is not yet defined. This is a forward reference. To handle this, we assume the struct will be defined later. + +[edit: Show the TypeStruct mapping] + +At the time of the `Person` struct definition, the `FamilyTree` struct is not +yet defined. This is a forward reference. To handle this, we assume the struct +will be defined later. + +[edit: swap to code reference] + ```java Type t = TYPES.get(tname); // Assume a forward-reference type @@ -56,55 +52,25 @@ Type t = TYPES.get(tname); _lexer._position = old2; } ``` + Reference fields start out as null, doing anything with them will result in a compile time error. ```java struct Person { - String name; - int age; - FamilyTree? tree; + String name; + int age; + FamilyTree? tree; } Person p = new Person; -p.tree.la = null; // Accessing unknown field 'la' from 'null' - +p.tree.left = null; // Accessing unknown field 'left' from 'null' ``` -It turns out `p.tree` is `null`, so we can't access the field `la` from it. -```java -// name = "tree" -// mem() is the current aggregate; its tree alias selects the initializing Store. -// in(3) = {ConstantNode@1651} "null" -return parsePostfix(new LoadNode(name, alias, declaredType.glb(), mem(), expr).peephole()); -``` -`LoadNode::idealize` -LoadNode first selects its alias through any MemMerge, then returns `st.val()` -when it finds a matching Store to the same object. -```java - // Simple Load-after-Store on same address. - if( mem() instanceof StoreNode st && - ptr() == st.ptr() && _alias == st._alias ) { // Same object and field - assert _name.equals(st._name); // Equiv class aliasing is perfect - return st.val(); // // <<-- {ConstantNode@1651} "null" - } -``` -After alias selection, the Load's `mem()` refers to that initializing Store. -In the next iteration, we will end up with: +It turns out `p.tree` is `null`, so we can't access the field `left` from it. -```java -... -// expr {ConstantNode@1651} "null" -// ptr = expr._type -// ptr = TypeMemPtr@1510 "null" -// ptr._obj._name = $TOP -TypeStruct base = (TypeStruct)TYPES.get(ptr._obj._name); -int idx = base==null ? -1 : base.find(name); // <<-- null -if( idx == -1 ) { - throw error("Accessing unknown field '" + name + "' from '" + ptr.str() + "'"); // throws here!!! -} -``` When we are creating the struct, we set up the initial value to Null: `newStruct`: + ```java private Node newStruct(TypeStruct obj) { Node n = new NewNode(TypeMemPtr.make(obj), ctrl()).peephole().keep(); @@ -160,17 +126,9 @@ This creates a circular reference. To resolve this, we auto deepen the forward r #### Auto deepen forward ref types -Auto deepening refers to the process where the compiler expands the forward reference into its complete definition. -When `a.next` is encountered, we auto deepen the type so its fields are going to be set. - -This is needed to resolve the stale type that the loop brings around. - -```java -if( e instanceof TypeMemPtr tmp && tmp._obj._fields==null ) { - e = tmp.make_from((TypeStruct) TYPES.get(tmp._obj._name)); -} -``` +Auto deepening refers to the process where the compiler expands the forward reference into its complete definition. +Here we have a simple linked list implementation, with the payload being a `int`. ```java struct LLI { LLI? next; int i; } @@ -182,12 +140,23 @@ while( arg ) { head = x; arg = arg-1; } -if( !head ) return 0; +if( !head ) return 0; LLI? next = head.next; if( next==null ) return 1; return next.i; ``` +When `a.next` is encountered, we auto deepen the type so its fields are going to be set. + +This is needed to resolve the stale type that the loop brings around. + +```java +if( e instanceof TypeMemPtr tmp && tmp._obj._fields==null ) { + e = tmp.make_from((TypeStruct) TYPES.get(tmp._obj._name)); +} +``` + + --- Normal field syntax works: @@ -208,62 +177,37 @@ And: ```java struct N { N next; int i; } N n = new N; -n.next = null; // <<-- Compile error, cannot store null into not-null field +n.next = null; // Error, cannot store null into not-null field return n.next; ``` Forward references must be specified later and field access is later checked. -## Global Code Motion walkthrough -Now that we have all these new features covered consider the following example: -```java -struct Person { - String name; - int age; - FamilyTree? tree; -} -Person p = new Person; -p.age =1; -return p.age; -``` -Reverse post order: Traverse nodes before their children. (Opposite of post order). -Loop through the post order list from the end to the beginning. -RPO = `[StartNode, CProjNode("ctrl"), ReturnNode("return 1"), StopNode("return 1"), XctrlNode("Xctrl")]` -> all the control nodes. - -Remember, with constants we want to schedule them to the deepest basic block. -For example a constant node will have StartNode as its in(0) but we can find a better replacement. -Early schedule: - -Does not change anything here: - -#### Early schedule: -``` -From: Start to: Start|#1(18) -From: Start to: Start|#null(12) -From: $ctrl to: $ctrl|.name=(13) -From: $ctrl to: $ctrl|.age=(19) -From: $ctrl to: $ctrl|.tree=(17) +## `LoadNode::idealize` +LoadNode first selects its alias through any MemMerge, then returns `st.val()` +when it finds a matching Store to the same object. +```java + // Simple Load-after-Store on same address. + if( mem() instanceof StoreNode st && + ptr() == st.ptr() && _alias == st._alias ) { // Same object and field + assert _name.equals(st._name); // Equiv class aliasing is perfect + return st.val(); // // <<-- {ConstantNode@1651} "null" + } ``` -The control nodes are already set so the early schedule is useless. -All the nodes involved: Return, Constant, NewNode specify their control input explicitly so there is nothing to do. +After alias selection, the Load's `mem()` refers to that initializing Store. +In the next iteration, we will end up with: -#### Late schedule: -``` -From: Start to: $ctrl(12) -From: Start to: $ctrl(18) -``` -We see that the late schedule actually changes the control input of the StartNode to the $ctrl node in 2 cases. -The algo that does this is: ```java - // Walk up from the LCA to the early, looking for best place. This is -// the lowest execution frequency, approximated by least loop depth and -// deepest control flow. -CFGNode best = lca; -lca = lca.idom(); // Already found best for starting LCA -for( ; lca != early.idom(); lca = lca.idom() ) - if( better(lca,best) ) - best = lca; -assert !(best instanceof IfNode); +... +// expr {ConstantNode@1651} "null" +// ptr = expr._type +// ptr = TypeMemPtr@1510 "null" +// ptr._obj._name = $TOP +TypeStruct base = (TypeStruct)TYPES.get(ptr._obj._name); +int idx = base==null ? -1 : base.find(name); // <<-- null +if( idx == -1 ) { + throw error("Accessing unknown field '" + name + "' from '" + ptr.str() + "'"); // throws here!!! +} ``` diff --git a/chapter14/README.md b/chapter14/README.md index a68baa5c..50009f4a 100644 --- a/chapter14/README.md +++ b/chapter14/README.md @@ -3,10 +3,6 @@ [Previous: Chapter 13](../chapter13/README.md) | [Next: Chapter 15](../chapter15/README.md) -Memory retains the single `$mem` binding and lazy partitions from Chapter 10b. -Narrow-field stores perform this chapter's truncation before updating their -alias in MemMerge. Start and Return keep control in slot 0 and memory in slot 1. - # Table of Contents 1. [Narrow Word Types](#narrow-or-sub-word-types) diff --git a/docs/chapter-backports.md b/docs/chapter-backports.md index 02c0574a..6193a65a 100644 --- a/docs/chapter-backports.md +++ b/docs/chapter-backports.md @@ -350,6 +350,14 @@ lines beyond the original extraction. ### Other pending corrections +- **Float-to-integer conversion (new feature).** Missing from Chapters 12-25; + Chapter 14's `RoundF32Node` only narrows floats to `f32`. Add an explicit + conversion, with Chapter 12 as the proposed introduction, and carry it + through the later chapters. Decide syntax, rounding versus truncation, + and behavior for NaN, infinities, and out-of-range values before implementing. + Cover constant folding, evaluation, and machine lowering on all three targets; + update the Chapter 12 explanation and add boundary-case regressions. + - **Existing Chapter 18 floating-array assertion.** The unchanged `TypeStruct.makeAry` assertion accepts integers and nullable references but excludes TypeFloat; `return new flt[1];` fails under `-ea`. The Chapter 18 diff --git a/graph/README.md b/graph/README.md index f7037548..8d3850e7 100644 --- a/graph/README.md +++ b/graph/README.md @@ -156,6 +156,18 @@ This keeps both graphs side by side in the chapter README. Chapter 10a's [load-after-store example](../chapter10a/README.md#local-memory-optimizations) uses this format to isolate a single rewrite. +Choose how much control to show according to the lesson. Keep it when teaching +control construction, branch elimination, loop nesting, or `break`/`continue`. +For a value rewrite inside an otherwise obvious branch or loop, omit the +routine CFG and its predicate-only computations, while preserving Phi data +inputs and their order. Chapter 5's arithmetic/Phi examples and Chapter 9's +optimization examples use this convention. Detached True/False projections +can identify important gates, including the two Returns in Chapter 9's first +GVN example. Describe omitted context in the caption or surrounding text. +If a snapshot omits a Loop, retain `"backedge": true` on its Phis' backedge +inputs so layout still puts the loop header values above their updates. This +is a documentation layout hint; live snapshots derive it from the Loop node. + The memory diagrams in 10a, 10b, and 11 also use viewer snapshots, with definitions above uses (apart from loop backedges) and arrows from use to definition. They omit control-flow context, including Regions and their Phi bindings, diff --git a/graph/web/layout.js b/graph/web/layout.js index 04d6f338..bd164854 100644 --- a/graph/web/layout.js +++ b/graph/web/layout.js @@ -155,9 +155,10 @@ class GraphLayout { const bundle = e.refs.length > 1; const id = bundle ? `b${use.id}d${e.def}` : "e" + e.orig.use + "i" + e.orig.idx; const reg = byId.get(use.edges[0]?.def)?.n; - const back = !use.fold && e.idx === 2 && (use.kind === "LOOP" || - (use.kind === "PHI" && reg?.kind === "LOOP")); - const loop = back ? (use.kind === "LOOP" ? use.id : reg.id) : 0; + // Focused documentation can omit the Loop but retain its backedge cue. + const back = !use.fold && (e.backedge === true || (e.idx === 2 && + (use.kind === "LOOP" || (use.kind === "PHI" && reg?.kind === "LOOP")))); + const loop = back ? (use.kind === "LOOP" ? use.id : (reg?.kind === "LOOP" ? reg.id : 0)) : 0; const wrap = loop && view.groups.has(loop) && !raw.get(loop).fold ? loop : 0; if (wrap) backs.set(wrap, (backs.get(wrap) || 0) + 1); edges.push({id, use: use.id, def: e.def, idx: e.orig.idx, orig: e.orig, refs: e.refs, bundle, role: e.role, label: e.label, -- cgit v1.2.3