diff options
| author | Dibyendu Majumdar <dibyendumajumdar@users.noreply.github.com> | 2024-04-23 17:23:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-23 09:23:16 -0700 |
| commit | 17f9d743c06170f20773863bd1eca4f25ef41490 (patch) | |
| tree | a6e3ab1fec4e23d7259305701dc571242637c69f /chapter10/docs | |
| parent | ce45fc4e749ceb130068d83801a6d4c080fd70d3 (diff) | |
| download | Simple-17f9d743c06170f20773863bd1eca4f25ef41490.tar.gz Simple-17f9d743c06170f20773863bd1eca4f25ef41490.zip | |
Ch10 (#74)
* Chapter 10 start
* #67 language grammar for chapter 10
* #67 Fix chapter title
* #67 Fix typo
* #67 assignment to fields
* #67 Struct var decl must be initialized
* #67 Start to describe memory and aliasing
* #67 revision
* #67 Start to describe how we construct the graph
* #67 Start to describe how we construct the graph
* #67 Start to describe how we construct the graph
* #67 Parse struct declaration
* #67 WIP parse expressions and statements involving struct vars
* #67 WIP parse store expressions
* #67 WIP parse load expressions
* #67 WIP first go at adding aliases and memslices
* #67 WIP A store should get bound to the $mem alias replacing previous node
* #67 WIP Add MergeMem node
* Update script generator to new features (#68)
* #67 WIP Drop MergeMem node
* #67 WIP Drop MergeMem node
* #67 WIP Improve parsing of postfix expressions
* #67 WIP Improve parsing of postfix expressions
* #67 WIP Update xmeet - these types can only meet another of the same type
* #67 WIP Phi's compute should return input type if input is a MemPtr even if region is in progress because parser needs the correct type
* #67 WIP If a null meets a non-null ptr then non-null wins; but ideally we want to retain type of null so we do not have this problem
* #67 WIP If a null meets a non-null ptr then non-null then the result is type|null
* #67 WIP Fix TypeMemPtr.eq() and also intern struct types
* #67 WIP Add missing hash and eq implementations
Also refactor common code to get field from ptr
* #67 Add START as input to New (as proxy for Mem).
Other minor adjustments
* #67 Phis widen type inside a loop during parse
* #67 Fix redeclaration bug
* #67 Small refactor
* #67 Add an LLVM inspired IR printer based on post by Yasser A
* #67 Add instructions to initialize fields of a struct after a new
* #67 Make New's ctrl input the current ctrl rather than Start
* #67 Refactor to make it cleaner
* #67 Fix bug - interned types should be cleared
* #67 Fix bug - new node must be kept so that its not prematurely killed
* #67 Fix bug - we must do a depp comparison of structs because types get interned and we can't easily clear the interned types across runs, this means we can end up with structs retaining definitions from older runs.
* #67 Refactor
* #67 When we compute type of a Phi we must stay within the domain of the Phi, Example Int stays Int, Ptr stays Ptr, Control stays Control, Mem stays Mem. To ensure this we need to default to the GLB of the first input
* #67 When we compute type of a Phi we must stay within the domain of the Phi, Example Int stays Int, Ptr stays Ptr, Control stays Control, Mem stays Mem. To ensure this we need to default to the GLB of the first input
* #67 Tidy up printing and add expected result on tests
* #67 Refactor TypeStruct
* #67 Refactor TypeStruct
When printing IR in new format - show the projection index
* #67 Revise the lattice for ptr types to make it more complete
* #67 Revise the lattice for mem and struct types. Add initial test
* #67 Refactor how we compute phi type
* #67 Refactor how we compute phi type
* #67 Use the generated graph but an edge is missing in the graph - to be investigated
* #67 One more tweek
* Partial work on ch10, some tests busted
Revamp Types Mem, MemPtr, Struct, FIeld.
Add tests to enforce theoretical rules properties.,
Add parsing "?" to allow nullable types.
Enhance GraphViz to show off mem better.
Strip trailing WS in many files.
* Strip trailing WS
* Post-peephole errors
Some nicer error reporting for types.
Mem Projs following StartNode are indexed by alias, but may have "holes" in the set of projs.
* WS cleanup
* Simplify TMP dual
Add more test type
Rename test type so makefile picks it up
Failing 1 test
* Scopes and Phis track declared type
...not the initial type.
* A fuzzer found bug
* Some changes on the fuzzer and maybe faster reducer (#69)
* WS and printing changes
* Kotlin style null checks (partial)
Allow `ptr=rand?; if( ptr ) ptr.field` where the if-test upcasts the ptr to not-null.
Field assignments are expressions not statements: `if( (ptr.fld=rez) !=null ) .... `
Many WS changes.
* missed cleanup
* Fuzzer update (#71)
* Update script generator
* Fix script generator
* Reset type cache to prevent alias blowup (#70)
* Reset type cache to prevent alias blowup
* Remove the default intern
Just reset the UNIQUE_ALIAS number. Intern table doesn't care, that's the whole point of the intern table. Passes existing tests, but fuzzer finds some new stuff
* Fix a few of the fuzzer bugs
More to come
* Fix one more fuzzer bug
---------
Co-authored-by: Cliff Click <cliffc@acm.org>
* Fix script generated generating invalid code
* Greatly simplify Cast usage
Casts peephole normally.
Added needed Phi optimizations to remove excess casts.
Fuzzer bug fixes:
Need a plain kill unused on worklist.
MemOp error handles aTOP/BOT input.
* #67 Add description of lattice to the doc
Update grammar - add the '?' nullable syntax
Rename VOID to PTR
* #67 Some renames
* #67 some more text re lattice
* #67 Fix the alias ID start to 2
* #67 Revise lattice diagram and doc
* #67 Start describing the parser changes and Null Pointer analysis
* #67 Draw lattice diagram using graphviz
* #67 Revisions to text
* #67 Improve description of alias classes
* #67 Some renames to make code clearer
* #67 Describe null pointer analysis
* Fix script generated generating invalid code (#72)
* updates to readme
shorter example names to make a nicer graph
* #67 Revise top level README
* #67 Revise top level README
---------
Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com>
Co-authored-by: Cliff Click <cliffc@acm.org>
Co-authored-by: XmiliaH <xmilia.hermit@gmail.com>
Diffstat (limited to 'chapter10/docs')
| -rw-r--r-- | chapter10/docs/10-grammar.md | 128 | ||||
| -rw-r--r-- | chapter10/docs/build-graphs.sh | 3 | ||||
| -rw-r--r-- | chapter10/docs/example1.drawio | 234 | ||||
| -rw-r--r-- | chapter10/docs/example1.gv | 84 | ||||
| -rw-r--r-- | chapter10/docs/example1.svg | 321 | ||||
| -rw-r--r-- | chapter10/docs/lattice.drawio | 379 | ||||
| -rw-r--r-- | chapter10/docs/lattice.gv | 122 | ||||
| -rw-r--r-- | chapter10/docs/lattice.svg | 460 |
8 files changed, 1731 insertions, 0 deletions
diff --git a/chapter10/docs/10-grammar.md b/chapter10/docs/10-grammar.md new file mode 100644 index 00000000..cb68df3d --- /dev/null +++ b/chapter10/docs/10-grammar.md @@ -0,0 +1,128 @@ +# Grammar for Chapter 10 + +```antlrv4 +grammar SimpleLanguage; + +program + : statement+ EOF + ; + +statement + : returnStatement + | structDeclaration + | declStatement + | blockStatment + | expressionStatement + | ifStatement + | whileStatement + | breakStatement + | continueStatment + | metaStatement + ; + +field + : 'int' IDENTIFIER ';' + ; + +fields + : field+ + ; + +structDeclaration + : 'struct' IDENTIFIER '{' fields '}' + ; + +whileStatement + : 'while' '(' expression ')' statement + ; + +breakStatement + : 'break' ';' + ; + +continueStatement + : 'continue' ';' + ; + +ifStatement + : 'if' '(' expression ')' statement ('else' statement)? + ; + +metaStatement + : '#showGraph' ';' + ; + +expressionStatement + : IDENTIFIER '=' expression ';' + | fieldExpression '=' expression ';' + ; + +blockStatement + : '{' statement+ '}' + ; + +structName + : IDENTIFIER + ; + +declStatement + : 'int' IDENTIFIER '=' expression ';' + | structName IDENTIFIER ('?')? '=' expression ';' + ; + +returnStatement + : 'return' expression ';' + ; + +expression + : comparisonExpression + ; + +comparisonExpression + : additiveExpression (('==' | '!='| '>'| '<'| '>='| '<=') additiveExpression)* + ; + +additiveExpression + : multiplicativeExpression (('+' | '-') multiplicativeExpression)* + ; + +multiplicativeExpression + : unaryExpression (('*' | '/') unaryExpression)* + ; + +unaryExpression + : ('-') unaryExpression + | primaryExpression + ; + +newExpression + : 'new' IDENTIFIER + ; + +fieldExpression + : primaryExpresson '.' IDENTIFIER + ; + +primaryExpression + : IDENTIFIER + | INTEGER_LITERAL + | 'true' + | 'false' + | 'null' + | newExpression + | '(' expression ')' + | fieldExpression + ; + +INTEGER_LITERAL + : [1-9][0-9]* + | [0] + ; + +IDENTIFIER + : NON_DIGIT (NON_DIGIT | DIGIT)* + ; + +NON_DIGIT: [a-zA-Z_]; +DEC_DIGIT: [0-9]; +```
\ No newline at end of file diff --git a/chapter10/docs/build-graphs.sh b/chapter10/docs/build-graphs.sh new file mode 100644 index 00000000..853f50f7 --- /dev/null +++ b/chapter10/docs/build-graphs.sh @@ -0,0 +1,3 @@ +dot -Tsvg example1.gv > example1.svg +dot -Tsvg lattice.gv > lattice.svg + diff --git a/chapter10/docs/example1.drawio b/chapter10/docs/example1.drawio new file mode 100644 index 00000000..b3b408c5 --- /dev/null +++ b/chapter10/docs/example1.drawio @@ -0,0 +1,234 @@ +<mxfile host="65bd71144e"> + <diagram id="pVfa21MziEbxiRWqA5Sa" name="Page-1"> + <mxGraphModel dx="1780" dy="907" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> + <root> + <mxCell id="0"/> + <mxCell id="1" parent="0"/> + <mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="280" y="20" width="160" height="90" as="geometry"/> + </mxCell> + <mxCell id="3" value="Start" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="280" y="20" width="160" height="40" as="geometry"/> + </mxCell> + <mxCell id="4" value="$ctrl" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="290" y="70" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="5" value="arg" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="340" y="70" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="6" value="Mem" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="390" y="70" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="8" style="edgeStyle=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="7" target="6"> + <mxGeometry relative="1" as="geometry"/> + </mxCell> + <mxCell id="7" value="new Vec2D" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="360" y="210" width="100" height="40" as="geometry"/> + </mxCell> + <mxCell id="9" value="#1" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"> + <mxGeometry x="720" y="200" width="80" height="80" as="geometry"/> + </mxCell> + <mxCell id="12" style="edgeStyle=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="10" target="51"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="385" y="270" as="targetPoint"/> + <Array as="points"> + <mxPoint x="550" y="360"/> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="13" style="edgeStyle=none;html=1;exitX=0.75;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="10" target="9"> + <mxGeometry relative="1" as="geometry"> + <mxPoint x="550" y="230" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="10" value="Store .x" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="650" y="350" width="120" height="60" as="geometry"/> + </mxCell> + <mxCell id="11" value="alias 1" style="endArrow=classic;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" edge="1" parent="1" source="10" target="52"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="420" y="290" as="sourcePoint"/> + <mxPoint x="470" y="240" as="targetPoint"/> + <Array as="points"> + <mxPoint x="610" y="290"/> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="14" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="275" y="410" width="90" height="80" as="geometry"/> + </mxCell> + <mxCell id="15" value="" style="curved=1;endArrow=classic;html=1;" edge="1" parent="1" source="39" target="5"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="170" y="200" as="sourcePoint"/> + <mxPoint x="450" y="370" as="targetPoint"/> + <Array as="points"/> + </mxGeometry> + </mxCell> + <mxCell id="16" value="If" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="275" y="410" width="90" height="30" as="geometry"/> + </mxCell> + <mxCell id="17" value="T" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="285" y="450" width="30" height="30" as="geometry"/> + </mxCell> + <mxCell id="18" value="F" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="325" y="450" width="30" height="30" as="geometry"/> + </mxCell> + <mxCell id="19" value="Store .y" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="110" y="430" width="120" height="60" as="geometry"/> + </mxCell> + <mxCell id="20" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="19" target="52"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="170" y="480" as="sourcePoint"/> + <mxPoint x="220" y="430" as="targetPoint"/> + <Array as="points"> + <mxPoint x="290" y="360"/> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="21" value="alias 2" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" vertex="1" connectable="0" parent="20"> + <mxGeometry x="-0.2147" y="-1" relative="1" as="geometry"> + <mxPoint x="-15" y="30" as="offset"/> + </mxGeometry> + </mxCell> + <mxCell id="22" value="#2" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"> + <mxGeometry x="60" y="295" width="80" height="80" as="geometry"/> + </mxCell> + <mxCell id="23" value="" style="endArrow=classic;html=1;" edge="1" parent="1" source="19" target="22"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="140" y="430" as="sourcePoint"/> + <mxPoint x="190" y="380" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="24" value="" style="endArrow=classic;html=1;" edge="1" parent="1" source="19" target="51"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="200" y="430" as="sourcePoint"/> + <mxPoint x="380" y="280" as="targetPoint"/> + <Array as="points"> + <mxPoint x="270" y="290"/> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="29" style="edgeStyle=none;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="1" source="25" target="27"> + <mxGeometry relative="1" as="geometry"/> + </mxCell> + <mxCell id="25" value="Store .y" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1"> + <mxGeometry x="440" y="490" width="90" height="60" as="geometry"/> + </mxCell> + <mxCell id="26" value="" style="endArrow=classic;html=1;" edge="1" parent="1" source="25" target="51"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="400" y="420" as="sourcePoint"/> + <mxPoint x="430" y="300" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="27" value="#3" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"> + <mxGeometry x="540" y="420" width="80" height="80" as="geometry"/> + </mxCell> + <mxCell id="28" value="alias 2" style="endArrow=classic;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="25" target="52"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="320" y="520" as="sourcePoint"/> + <mxPoint x="350" y="450" as="targetPoint"/> + <Array as="points"> + <mxPoint x="480" y="350"/> + </Array> + </mxGeometry> + </mxCell> + <mxCell id="30" value="Region" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="250" y="600" width="120" height="60" as="geometry"/> + </mxCell> + <mxCell id="31" value="" style="endArrow=classic;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.392;exitY=-0.064;exitDx=0;exitDy=0;exitPerimeter=0;fillColor=#a20025;strokeColor=#6F0000;" edge="1" parent="1" source="30" target="17"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="265" y="570" as="sourcePoint"/> + <mxPoint x="315" y="520" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="32" value="" style="endArrow=classic;html=1;exitX=0.75;exitY=0;exitDx=0;exitDy=0;fillColor=#a20025;strokeColor=#6F0000;" edge="1" parent="1" source="30" target="18"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="310" y="570" as="sourcePoint"/> + <mxPoint x="360" y="520" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="35" style="edgeStyle=none;html=1;exitX=1;exitY=1;exitDx=0;exitDy=0;" edge="1" parent="1" source="33" target="30"> + <mxGeometry relative="1" as="geometry"/> + </mxCell> + <mxCell id="33" value="phi" style="ellipse;whiteSpace=wrap;html=1;fillColor=#fad7ac;strokeColor=#b46504;fontColor=#0e0101;" vertex="1" parent="1"> + <mxGeometry x="90" y="540" width="120" height="80" as="geometry"/> + </mxCell> + <mxCell id="36" value="" style="endArrow=classic;html=1;" edge="1" parent="1" source="33" target="19"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="170" y="560" as="sourcePoint"/> + <mxPoint x="220" y="510" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="37" value="" style="endArrow=classic;html=1;" edge="1" parent="1" source="33" target="25"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="170" y="560" as="sourcePoint"/> + <mxPoint x="220" y="510" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="38" value="" style="curved=1;endArrow=classic;html=1;startArrow=none;fillColor=#a20025;strokeColor=#6F0000;" edge="1" parent="1" source="16" target="4"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="295" y="330" as="sourcePoint"/> + <mxPoint x="307.14285714285734" y="80" as="targetPoint"/> + <Array as="points"/> + </mxGeometry> + </mxCell> + <mxCell id="39" value="==" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"> + <mxGeometry x="130" y="180" width="80" height="80" as="geometry"/> + </mxCell> + <mxCell id="41" value="#1" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" vertex="1" parent="1"> + <mxGeometry x="50" y="60" width="80" height="80" as="geometry"/> + </mxCell> + <mxCell id="42" value="" style="endArrow=classic;html=1;" edge="1" parent="1" source="39" target="41"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="140" y="150" as="sourcePoint"/> + <mxPoint x="190" y="100" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="49" style="edgeStyle=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;fontColor=default;fillColor=#e51400;strokeColor=#B20000;" edge="1" parent="1" source="43" target="30"> + <mxGeometry relative="1" as="geometry"/> + </mxCell> + <mxCell id="43" value="Return" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e3c800;fontColor=#000000;strokeColor=#B09500;" vertex="1" parent="1"> + <mxGeometry x="250" y="850" width="120" height="60" as="geometry"/> + </mxCell> + <mxCell id="44" value="Merge Mem" style="rounded=0;whiteSpace=wrap;html=1;fontColor=default;" vertex="1" parent="1"> + <mxGeometry x="365" y="730" width="120" height="60" as="geometry"/> + </mxCell> + <mxCell id="45" value="" style="endArrow=classic;html=1;fontColor=default;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" target="51"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="410" y="730" as="sourcePoint"/> + <mxPoint x="400" y="300" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="46" value="" style="endArrow=classic;html=1;fontColor=default;" edge="1" parent="1" source="44" target="10"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="600" y="680" as="sourcePoint"/> + <mxPoint x="650" y="630" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="47" value="" style="endArrow=classic;html=1;fontColor=default;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" edge="1" parent="1" source="44" target="33"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="160" y="800" as="sourcePoint"/> + <mxPoint x="210" y="750" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="50" value="" style="endArrow=classic;html=1;fontColor=default;" edge="1" parent="1" source="43" target="44"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="305" y="860" as="sourcePoint"/> + <mxPoint x="355" y="810" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="51" value="ptr" style="rounded=0;whiteSpace=wrap;html=1;fontColor=default;" vertex="1" parent="1"> + <mxGeometry x="365" y="250" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="52" value="mem" style="rounded=0;whiteSpace=wrap;html=1;fontColor=default;" vertex="1" parent="1"> + <mxGeometry x="405" y="250" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="55" value="" style="endArrow=classic;html=1;fontColor=default;" edge="1" parent="1" source="16" target="39"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="400" y="490" as="sourcePoint"/> + <mxPoint x="450" y="440" as="targetPoint"/> + </mxGeometry> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile>
\ No newline at end of file diff --git a/chapter10/docs/example1.gv b/chapter10/docs/example1.gv new file mode 100644 index 00000000..fcc24154 --- /dev/null +++ b/chapter10/docs/example1.gv @@ -0,0 +1,84 @@ +digraph chapter10 { +/* +struct Vec2D { int x; int y; } + +Vec2D v = new Vec2D; +v.x = 1; +if (arg) + v.y = 2; +else + v.y = 3; +return v; + +*/ + rankdir=BT; + ordering="in"; + concentrate="true"; + compound="true"; + subgraph cluster_Nodes { + Start2 [ shape=plaintext label=< + <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> + <TR><TD BGCOLOR="yellow">Start</TD></TR> + <TR><TD> + <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> + <TR><TD PORT="p0" BGCOLOR="yellow">$ctrl</TD><TD PORT="p1">arg</TD><TD PORT="p2">$Vec2D_x</TD><TD PORT="p3">$Vec2D_y</TD></TR> + </TABLE> + </TD></TR> + </TABLE>> + ]; + Stop3 [ shape=box style=filled fillcolor=yellow label="Stop" ]; + New8 [ label="new Vec2D" ]; + Con_9 [ label="#0" ]; + Store10 [ label="Store" ]; + Store11 [ label="Store" ]; + Con_12 [ label="#1" ]; + Store13 [ label="Store" ]; + If14 [ shape=plaintext label=< + <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> + <TR><TD BGCOLOR="yellow">If</TD></TR> + <TR><TD> + <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0"> + <TR><TD PORT="p0" BGCOLOR="yellow">True</TD><TD PORT="p1" BGCOLOR="yellow">False</TD></TR> + </TABLE> + </TD></TR> + </TABLE>> + ]; + Con_18 [ label="#2" ]; + Store19 [ label="Store" ]; + Con_20 [ label="#3" ]; + Store21 [ label="Store" ]; + Region22 [ shape=box style=filled fillcolor=yellow label="Region" ]; + Phi_Vec2D_y23 [ style=filled fillcolor=lightyellow label="φ_$Vec2D_y" ]; + Return24 [ shape=box style=filled fillcolor=yellow label="Return" ]; + { rank=same; Region22;Phi_Vec2D_y23;} + } + edge [ fontname=Helvetica, fontsize=8 ]; + Stop3 -> Return24[taillabel=0 color=red]; + New8 -> Start2:p0[taillabel=0 color=green]; + Store10 -> Start2:p2[taillabel=1]; + Store10 -> New8[taillabel=2]; + Store10 -> Con_9[taillabel=3]; + Store11 -> Start2:p3[taillabel=1]; + Store11 -> New8[taillabel=2]; + Store11 -> Con_9[taillabel=3]; + Store13 -> Store10[taillabel=1]; + Store13 -> New8[taillabel=2]; + Store13 -> Con_12[taillabel=3]; + If14 -> Start2:p0[taillabel=0 color=red]; + If14 -> Start2:p1[taillabel=1]; + Store19 -> Store11[taillabel=1]; + Store19 -> New8[taillabel=2]; + Store19 -> Con_18[taillabel=3]; + Store21 -> Store11[taillabel=1]; + Store21 -> New8[taillabel=2]; + Store21 -> Con_20[taillabel=3]; + Region22 -> If14:p0[taillabel=1 color=red]; + Region22 -> If14:p1[taillabel=2 color=red]; + Phi_Vec2D_y23 -> Region22 [style=dotted taillabel=0]; + Phi_Vec2D_y23 -> Store19[taillabel=1]; + Phi_Vec2D_y23 -> Store21[taillabel=2 constraint=false]; + Return24 -> Region22[taillabel=0 color=red]; + Return24 -> New8[taillabel=1]; + Return24 -> Store13[taillabel=2]; + Return24 -> Phi_Vec2D_y23[taillabel=3]; +} diff --git a/chapter10/docs/example1.svg b/chapter10/docs/example1.svg new file mode 100644 index 00000000..0c2dfa4d --- /dev/null +++ b/chapter10/docs/example1.svg @@ -0,0 +1,321 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Generated by graphviz version 2.43.0 (0) + --> +<!-- Title: chapter10 Pages: 1 --> +<svg width="518pt" height="564pt" + viewBox="0.00 0.00 518.00 564.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 560)"> +<title>chapter10</title> +<polygon fill="white" stroke="transparent" points="-4,4 -4,-560 514,-560 514,4 -4,4"/> +<g id="clust1" class="cluster"> +<title>cluster_Nodes</title> +<polygon fill="none" stroke="black" points="8,-8 8,-548 502,-548 502,-8 8,-8"/> +</g> +<!-- Start2 --> +<g id="node1" class="node"> +<title>Start2</title> +<polygon fill="yellow" stroke="transparent" points="212,-511 212,-536 487,-536 487,-511 212,-511"/> +<polygon fill="none" stroke="black" points="212,-511 212,-536 487,-536 487,-511 212,-511"/> +<text text-anchor="start" x="331" y="-519.8" font-family="Times,serif" font-size="14.00">Start</text> +<polygon fill="none" stroke="black" points="212,-480 212,-511 487,-511 487,-480 212,-480"/> +<polygon fill="yellow" stroke="transparent" points="217,-485 217,-506 257,-506 257,-485 217,-485"/> +<polygon fill="none" stroke="black" points="217,-485 217,-506 257,-506 257,-485 217,-485"/> +<text text-anchor="start" x="220" y="-491.8" font-family="Times,serif" font-size="14.00">$ctrl</text> +<polygon fill="none" stroke="black" points="257,-485 257,-506 288,-506 288,-485 257,-485"/> +<text text-anchor="start" x="260" y="-491.8" font-family="Times,serif" font-size="14.00">arg</text> +<polygon fill="none" stroke="black" points="288,-485 288,-506 385,-506 385,-485 288,-485"/> +<text text-anchor="start" x="291" y="-491.8" font-family="Times,serif" font-size="14.00">$Vector2D_x</text> +<polygon fill="none" stroke="black" points="385,-485 385,-506 482,-506 482,-485 385,-485"/> +<text text-anchor="start" x="388" y="-491.8" font-family="Times,serif" font-size="14.00">$Vector2D_y</text> +</g> +<!-- Stop3 --> +<g id="node2" class="node"> +<title>Stop3</title> +<polygon fill="yellow" stroke="black" points="386,-52 332,-52 332,-16 386,-16 386,-52"/> +<text text-anchor="middle" x="359" y="-30.3" font-family="Times,serif" font-size="14.00">Stop</text> +</g> +<!-- Return24 --> +<g id="node16" class="node"> +<title>Return24</title> +<polygon fill="yellow" stroke="black" points="392,-124 326,-124 326,-88 392,-88 392,-124"/> +<text text-anchor="middle" x="359" y="-102.3" font-family="Times,serif" font-size="14.00">Return</text> +</g> +<!-- Stop3->Return24 --> +<g id="edge1" class="edge"> +<title>Stop3->Return24</title> +<path fill="none" stroke="red" d="M359,-52.3C359,-60.02 359,-69.29 359,-77.89"/> +<polygon fill="red" stroke="red" points="355.5,-77.9 359,-87.9 362.5,-77.9 355.5,-77.9"/> +<text text-anchor="middle" x="356" y="-54.9" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> +</g> +<!-- New8 --> +<g id="node3" class="node"> +<title>New8</title> +<ellipse fill="none" stroke="black" cx="247" cy="-408" rx="98.58" ry="18"/> +<text text-anchor="middle" x="247" y="-404.3" font-family="Times,serif" font-size="14.00">New Ptr(Vector2D)</text> +</g> +<!-- New8->Start2 --> +<g id="edge2" class="edge"> +<title>New8->Start2:p0</title> +<path fill="none" stroke="green" d="M243.39,-426.19C241,-438.85 238.14,-456.79 237.27,-474"/> +<polygon fill="green" stroke="green" points="233.77,-473.91 237,-484 240.76,-474.1 233.77,-473.91"/> +<text text-anchor="middle" x="240.39" y="-428.79" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> +</g> +<!-- Con_9 --> +<g id="node4" class="node"> +<title>Con_9</title> +<ellipse fill="none" stroke="black" cx="103" cy="-408" rx="27" ry="18"/> +<text text-anchor="middle" x="103" y="-404.3" font-family="Times,serif" font-size="14.00">#0</text> +</g> +<!-- Store10 --> +<g id="node5" class="node"> +<title>Store10</title> +<ellipse fill="none" stroke="black" cx="124" cy="-322" rx="36.29" ry="18"/> +<text text-anchor="middle" x="124" y="-318.3" font-family="Times,serif" font-size="14.00">Store</text> +</g> +<!-- Store10->Start2 --> +<g id="edge3" class="edge"> +<title>Store10->Start2:p2</title> +<path fill="none" stroke="black" d="M102.14,-336.54C89.28,-345.86 74.18,-359.52 67,-376 55.64,-402.08 48.58,-418.32 67,-440 103.77,-483.27 308.02,-430.84 333.41,-474.03"/> +<polygon fill="black" stroke="black" points="330.1,-475.2 336,-484 336.87,-473.44 330.1,-475.2"/> +<text text-anchor="middle" x="99.14" y="-339.14" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Store10->New8 --> +<g id="edge4" class="edge"> +<title>Store10->New8</title> +<path fill="none" stroke="black" d="M144.59,-337.06C163.55,-350.01 191.99,-369.44 214.1,-384.53"/> +<polygon fill="black" stroke="black" points="212.3,-387.54 222.53,-390.29 216.25,-381.76 212.3,-387.54"/> +<text text-anchor="middle" x="141.59" y="-339.66" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Store10->Con_9 --> +<g id="edge5" class="edge"> +<title>Store10->Con_9</title> +<path fill="none" stroke="black" d="M119.75,-340C116.88,-351.5 113.02,-366.93 109.73,-380.08"/> +<polygon fill="black" stroke="black" points="106.27,-379.48 107.24,-390.03 113.06,-381.17 106.27,-379.48"/> +<text text-anchor="middle" x="116.75" y="-342.6" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> +</g> +<!-- Store11 --> +<g id="node6" class="node"> +<title>Store11</title> +<ellipse fill="none" stroke="black" cx="326" cy="-322" rx="36.29" ry="18"/> +<text text-anchor="middle" x="326" y="-318.3" font-family="Times,serif" font-size="14.00">Store</text> +</g> +<!-- Store11->Start2 --> +<g id="edge6" class="edge"> +<title>Store11->Start2:p3</title> +<path fill="none" stroke="black" d="M336.29,-339.76C342.27,-349.98 349.67,-363.45 355,-376 366.65,-403.43 357.77,-415.68 375,-440 391.62,-463.46 424.6,-454.4 432.35,-474.07"/> +<polygon fill="black" stroke="black" points="428.9,-474.71 434,-484 435.81,-473.56 428.9,-474.71"/> +<text text-anchor="middle" x="333.29" y="-342.36" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Store11->New8 --> +<g id="edge7" class="edge"> +<title>Store11->New8</title> +<path fill="none" stroke="black" d="M311.14,-338.8C299.53,-351.15 283.18,-368.53 269.89,-382.66"/> +<polygon fill="black" stroke="black" points="267.18,-380.44 262.88,-390.12 272.28,-385.23 267.18,-380.44"/> +<text text-anchor="middle" x="308.14" y="-341.4" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Store11->Con_9 --> +<g id="edge8" class="edge"> +<title>Store11->Con_9</title> +<path fill="none" stroke="black" d="M294.91,-331.44C243.56,-345.42 145.98,-372.24 139,-376 134.01,-378.69 129.1,-382.17 124.59,-385.82"/> +<polygon fill="black" stroke="black" points="122.22,-383.24 116.98,-392.45 126.82,-388.52 122.22,-383.24"/> +<text text-anchor="middle" x="291.91" y="-334.04" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> +</g> +<!-- Con_12 --> +<g id="node7" class="node"> +<title>Con_12</title> +<ellipse fill="none" stroke="black" cx="43" cy="-322" rx="27" ry="18"/> +<text text-anchor="middle" x="43" y="-318.3" font-family="Times,serif" font-size="14.00">#1</text> +</g> +<!-- Store13 --> +<g id="node8" class="node"> +<title>Store13</title> +<ellipse fill="none" stroke="black" cx="146" cy="-250" rx="36.29" ry="18"/> +<text text-anchor="middle" x="146" y="-246.3" font-family="Times,serif" font-size="14.00">Store</text> +</g> +<!-- Store13->New8 --> +<g id="edge10" class="edge"> +<title>Store13->New8</title> +<path fill="none" stroke="black" d="M153.54,-267.95C163.49,-290.05 180.7,-327.38 189,-340 198.92,-355.08 211.92,-370.41 223.11,-382.59"/> +<polygon fill="black" stroke="black" points="220.75,-385.2 230.14,-390.11 225.86,-380.41 220.75,-385.2"/> +<text text-anchor="middle" x="150.54" y="-270.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Store13->Store10 --> +<g id="edge9" class="edge"> +<title>Store13->Store10</title> +<path fill="none" stroke="black" d="M140.67,-267.95C138.22,-275.74 135.26,-285.18 132.51,-293.92"/> +<polygon fill="black" stroke="black" points="129.09,-293.14 129.43,-303.72 135.77,-295.23 129.09,-293.14"/> +<text text-anchor="middle" x="137.67" y="-270.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Store13->Con_12 --> +<g id="edge11" class="edge"> +<title>Store13->Con_12</title> +<path fill="none" stroke="black" d="M125.16,-265.17C109.24,-275.98 87.18,-290.98 69.92,-302.7"/> +<polygon fill="black" stroke="black" points="67.7,-299.98 61.4,-308.5 71.63,-305.77 67.7,-299.98"/> +<text text-anchor="middle" x="122.16" y="-267.77" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> +</g> +<!-- If14 --> +<g id="node9" class="node"> +<title>If14</title> +<polygon fill="yellow" stroke="transparent" points="392,-411 392,-436 486,-436 486,-411 392,-411"/> +<polygon fill="none" stroke="black" points="392,-411 392,-436 486,-436 486,-411 392,-411"/> +<text text-anchor="start" x="433.5" y="-419.8" font-family="Times,serif" font-size="14.00">If</text> +<polygon fill="none" stroke="black" points="392,-380 392,-411 486,-411 486,-380 392,-380"/> +<polygon fill="yellow" stroke="transparent" points="397,-385 397,-406 437,-406 437,-385 397,-385"/> +<polygon fill="none" stroke="black" points="397,-385 397,-406 437,-406 437,-385 397,-385"/> +<text text-anchor="start" x="400" y="-391.8" font-family="Times,serif" font-size="14.00">True</text> +<polygon fill="yellow" stroke="transparent" points="437,-385 437,-406 481,-406 481,-385 437,-385"/> +<polygon fill="none" stroke="black" points="437,-385 437,-406 481,-406 481,-385 437,-385"/> +<text text-anchor="start" x="440" y="-391.8" font-family="Times,serif" font-size="14.00">False</text> +</g> +<!-- If14->Start2 --> +<g id="edge12" class="edge"> +<title>If14->Start2:p0</title> +<path fill="none" stroke="red" d="M383.85,-434.38C379.19,-436.34 374.53,-438.24 370,-440 315.48,-461.2 246.02,-426.45 237.8,-473.79"/> +<polygon fill="red" stroke="red" points="234.3,-473.76 237,-484 241.27,-474.31 234.3,-473.76"/> +<text text-anchor="middle" x="380.85" y="-427.98" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> +</g> +<!-- If14->Start2 --> +<g id="edge13" class="edge"> +<title>If14->Start2:p1</title> +<path fill="none" stroke="black" d="M383.86,-433.77C346.61,-450.49 300.83,-471.05 281.42,-479.77"/> +<polygon fill="black" stroke="black" points="279.69,-476.71 272,-484 282.56,-483.1 279.69,-476.71"/> +<text text-anchor="middle" x="380.86" y="-436.37" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Con_18 --> +<g id="node10" class="node"> +<title>Con_18</title> +<ellipse fill="none" stroke="black" cx="225" cy="-322" rx="27" ry="18"/> +<text text-anchor="middle" x="225" y="-318.3" font-family="Times,serif" font-size="14.00">#2</text> +</g> +<!-- Store19 --> +<g id="node11" class="node"> +<title>Store19</title> +<ellipse fill="none" stroke="black" cx="281" cy="-250" rx="36.29" ry="18"/> +<text text-anchor="middle" x="281" y="-246.3" font-family="Times,serif" font-size="14.00">Store</text> +</g> +<!-- Store19->New8 --> +<g id="edge15" class="edge"> +<title>Store19->New8</title> +<path fill="none" stroke="black" d="M277.3,-267.99C271.45,-294.81 260.03,-347.21 253,-379.46"/> +<polygon fill="black" stroke="black" points="249.51,-379.04 250.8,-389.55 256.35,-380.53 249.51,-379.04"/> +<text text-anchor="middle" x="274.3" y="-270.59" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Store19->Store11 --> +<g id="edge14" class="edge"> +<title>Store19->Store11</title> +<path fill="none" stroke="black" d="M291.66,-267.59C297.1,-276.05 303.83,-286.51 309.88,-295.92"/> +<polygon fill="black" stroke="black" points="307.06,-298.01 315.41,-304.53 312.95,-294.23 307.06,-298.01"/> +<text text-anchor="middle" x="288.66" y="-270.19" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Store19->Con_18 --> +<g id="edge16" class="edge"> +<title>Store19->Con_18</title> +<path fill="none" stroke="black" d="M268.29,-266.88C261.03,-275.96 251.79,-287.51 243.71,-297.61"/> +<polygon fill="black" stroke="black" points="240.79,-295.66 237.27,-305.66 246.25,-300.04 240.79,-295.66"/> +<text text-anchor="middle" x="265.29" y="-269.48" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> +</g> +<!-- Con_20 --> +<g id="node12" class="node"> +<title>Con_20</title> +<ellipse fill="none" stroke="black" cx="427" cy="-322" rx="27" ry="18"/> +<text text-anchor="middle" x="427" y="-318.3" font-family="Times,serif" font-size="14.00">#3</text> +</g> +<!-- Store21 --> +<g id="node13" class="node"> +<title>Store21</title> +<ellipse fill="none" stroke="black" cx="381" cy="-250" rx="36.29" ry="18"/> +<text text-anchor="middle" x="381" y="-246.3" font-family="Times,serif" font-size="14.00">Store</text> +</g> +<!-- Store21->New8 --> +<g id="edge18" class="edge"> +<title>Store21->New8</title> +<path fill="none" stroke="black" d="M383.48,-267.99C385.36,-287.16 385.53,-318.48 371,-340 355.77,-362.56 330.37,-378.17 306.51,-388.6"/> +<polygon fill="black" stroke="black" points="305.01,-385.43 297.11,-392.49 307.69,-391.9 305.01,-385.43"/> +<text text-anchor="middle" x="380.48" y="-270.59" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Store21->Store11 --> +<g id="edge17" class="edge"> +<title>Store21->Store11</title> +<path fill="none" stroke="black" d="M368.24,-267.24C361.3,-276.07 352.58,-287.17 344.87,-296.99"/> +<polygon fill="black" stroke="black" points="342.11,-294.83 338.69,-304.85 347.62,-299.15 342.11,-294.83"/> +<text text-anchor="middle" x="365.24" y="-269.84" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Store21->Con_20 --> +<g id="edge19" class="edge"> +<title>Store21->Con_20</title> +<path fill="none" stroke="black" d="M391.67,-267.24C397.44,-276.02 404.68,-287.04 411.1,-296.81"/> +<polygon fill="black" stroke="black" points="408.29,-298.9 416.71,-305.33 414.14,-295.06 408.29,-298.9"/> +<text text-anchor="middle" x="388.67" y="-269.84" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> +</g> +<!-- Region22 --> +<g id="node14" class="node"> +<title>Region22</title> +<polygon fill="yellow" stroke="black" points="494,-196 428,-196 428,-160 494,-160 494,-196"/> +<text text-anchor="middle" x="461" y="-174.3" font-family="Times,serif" font-size="14.00">Region</text> +</g> +<!-- Region22->If14 --> +<g id="edge20" class="edge"> +<title>Region22->If14:p0</title> +<path fill="none" stroke="red" d="M468.66,-196.11C481.18,-226.8 502.33,-292.46 478,-340 464.62,-366.15 427.64,-354.5 418.88,-373.99"/> +<polygon fill="red" stroke="red" points="415.4,-373.53 417,-384 422.28,-374.82 415.4,-373.53"/> +<text text-anchor="middle" x="465.66" y="-198.71" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Phi_Vector2D_y23 --> +<g id="node15" class="node"> +<title>Phi_Vector2D_y23</title> +<ellipse fill="lightyellow" stroke="black" cx="310" cy="-178" rx="79.89" ry="18"/> +<text text-anchor="middle" x="310" y="-174.3" font-family="Times,serif" font-size="14.00">φ_$Vector2D_y</text> +</g> +<!-- Phi_Vector2D_y23->Store19 --> +<g id="edge23" class="edge"> +<title>Phi_Vector2D_y23->Store19</title> +<path fill="none" stroke="black" d="M302.98,-195.95C299.63,-204.03 295.55,-213.88 291.82,-222.89"/> +<polygon fill="black" stroke="black" points="288.55,-221.63 287.96,-232.21 295.02,-224.31 288.55,-221.63"/> +<text text-anchor="middle" x="299.98" y="-198.55" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Phi_Vector2D_y23->Store21 --> +<g id="edge24" class="edge"> +<title>Phi_Vector2D_y23->Store21</title> +<path fill="none" stroke="black" d="M327.19,-195.95C336.48,-205.1 348.07,-216.53 358.11,-226.43"/> +<polygon fill="black" stroke="black" points="355.85,-229.12 365.42,-233.64 360.76,-224.13 355.85,-229.12"/> +<text text-anchor="middle" x="324.19" y="-198.55" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Phi_Vector2D_y23->Region22 --> +<g id="edge22" class="edge"> +<title>Phi_Vector2D_y23->Region22</title> +<path fill="none" stroke="black" stroke-dasharray="1,5" d="M390.22,-178C399.33,-178 408.43,-178 417.54,-178"/> +<polygon fill="black" stroke="black" points="417.82,-181.5 427.82,-178 417.82,-174.5 417.82,-181.5"/> +<text text-anchor="middle" x="393.22" y="-171.6" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> +</g> +<!-- Return24->New8 --> +<g id="edge26" class="edge"> +<title>Return24->New8</title> +<path fill="none" stroke="black" d="M373.77,-124.44C381.82,-134.45 391.63,-147.49 399,-160 416.77,-190.17 455.73,-269.74 463,-304 466.32,-319.65 472.49,-327.12 463,-340 453.78,-352.52 373.24,-375.2 313.19,-390.68"/> +<polygon fill="black" stroke="black" points="312.19,-387.32 303.37,-393.19 313.93,-394.1 312.19,-387.32"/> +<text text-anchor="middle" x="370.77" y="-127.04" font-family="Helvetica,sans-Serif" font-size="8.00">1</text> +</g> +<!-- Return24->Store13 --> +<g id="edge27" class="edge"> +<title>Return24->Store13</title> +<path fill="none" stroke="black" d="M325.78,-114.7C296.32,-122.65 253.09,-137.15 221,-160 196.73,-177.27 175.54,-204.17 161.93,-223.87"/> +<polygon fill="black" stroke="black" points="158.9,-222.11 156.23,-232.36 164.71,-226.01 158.9,-222.11"/> +<text text-anchor="middle" x="322.78" y="-108.3" font-family="Helvetica,sans-Serif" font-size="8.00">2</text> +</g> +<!-- Return24->Region22 --> +<g id="edge25" class="edge"> +<title>Return24->Region22</title> +<path fill="none" stroke="red" d="M383.95,-124.12C397.04,-133.11 413.26,-144.24 427.44,-153.97"/> +<polygon fill="red" stroke="red" points="425.73,-157.04 435.95,-159.81 429.69,-151.27 425.73,-157.04"/> +<text text-anchor="middle" x="380.95" y="-126.72" font-family="Helvetica,sans-Serif" font-size="8.00">0</text> +</g> +<!-- Return24->Phi_Vector2D_y23 --> +<g id="edge28" class="edge"> +<title>Return24->Phi_Vector2D_y23</title> +<path fill="none" stroke="black" d="M346.89,-124.3C341.13,-132.53 334.14,-142.52 327.79,-151.58"/> +<polygon fill="black" stroke="black" points="324.84,-149.7 321.97,-159.9 330.58,-153.71 324.84,-149.7"/> +<text text-anchor="middle" x="343.89" y="-126.9" font-family="Helvetica,sans-Serif" font-size="8.00">3</text> +</g> +</g> +</svg> diff --git a/chapter10/docs/lattice.drawio b/chapter10/docs/lattice.drawio new file mode 100644 index 00000000..cf20e9f3 --- /dev/null +++ b/chapter10/docs/lattice.drawio @@ -0,0 +1,379 @@ +<mxfile host="65bd71144e"> + <diagram id="N4dXkE2PwwjNiNYLmPMg" name="Page-1"> + <mxGraphModel dx="1868" dy="907" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> + <root> + <mxCell id="0"/> + <mxCell id="1" parent="0"/> + <mxCell id="2" value="Top" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="527.5" y="40" width="40" height="40" as="geometry"/> + </mxCell> + <mxCell id="3" value="Int Top" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="140" y="195" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="4" value="Int Bot" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="140" y="350" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="5" value="Bot" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="524" y="710" width="47" height="47" as="geometry"/> + </mxCell> + <mxCell id="7" value="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="100" y="280" width="30" height="30" as="geometry"/> + </mxCell> + <mxCell id="8" value="2" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="130" y="278.85" width="30" height="30" as="geometry"/> + </mxCell> + <mxCell id="9" value="3" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="170" y="278.85" width="30" height="30" as="geometry"/> + </mxCell> + <mxCell id="10" value="n" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="220" y="278.85" width="20" height="30" as="geometry"/> + </mxCell> + <mxCell id="11" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="7" target="3" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="400" y="490" as="sourcePoint"/> + <mxPoint x="450" y="440" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="12" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="4" target="7" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="110" y="360" as="sourcePoint"/> + <mxPoint x="160" y="310" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="14" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="8" target="3" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="300" y="640" as="sourcePoint"/> + <mxPoint x="350" y="590" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="15" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="4" target="8" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="210" y="510" as="sourcePoint"/> + <mxPoint x="260" y="460" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="16" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="9" target="3" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="110" y="590" as="sourcePoint"/> + <mxPoint x="160" y="540" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="17" value="" style="endArrow=none;html=1;" parent="1" source="4" target="9" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="140" y="410" as="sourcePoint"/> + <mxPoint x="190" y="360" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="18" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="10" target="3" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="350" y="280" as="sourcePoint"/> + <mxPoint x="400" y="230" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="19" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="4" target="10" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="280" y="380" as="sourcePoint"/> + <mxPoint x="330" y="330" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="20" value="" style="endArrow=none;html=1;" parent="1" source="3" target="2" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="280" y="200" as="sourcePoint"/> + <mxPoint x="330" y="150" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="21" value="" style="endArrow=none;html=1;" parent="1" source="5" target="4" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="180" y="540" as="sourcePoint"/> + <mxPoint x="230" y="490" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="22" value="*$TOP" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="580" y="115" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="23" value="*$BOT?" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="562.5" y="540" width="75" height="75" as="geometry"/> + </mxCell> + <mxCell id="24" value="" style="endArrow=none;html=1;" parent="1" source="5" target="23" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="400" y="490" as="sourcePoint"/> + <mxPoint x="450" y="440" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="31" value="" style="endArrow=none;html=1;entryX=0;entryY=1;entryDx=0;entryDy=0;" parent="1" source="79" target="22" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="550" y="280" as="sourcePoint"/> + <mxPoint x="520" y="200" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="33" value="" style="endArrow=none;html=1;" parent="1" source="22" target="87" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="715" y="240" as="sourcePoint"/> + <mxPoint x="690" y="200" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="34" value="" style="endArrow=none;html=1;" parent="1" source="2" target="22" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="600" y="120" as="sourcePoint"/> + <mxPoint x="650" y="70" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="41" value="Struct<br>S1" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="295" y="270" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="42" value="Struct<br>S2" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="370" y="270" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="43" value="" style="endArrow=none;html=1;" parent="1" source="41" target="56" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="343" y="240" as="sourcePoint"/> + <mxPoint x="333" y="210" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="44" value="" style="endArrow=none;html=1;" parent="1" source="57" target="41" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="343" y="360" as="sourcePoint"/> + <mxPoint x="383" y="400" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="45" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=1;entryY=1;entryDx=0;entryDy=0;" parent="1" source="42" target="56" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="393" y="230" as="sourcePoint"/> + <mxPoint x="353" y="220" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="46" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="57" target="42" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="373" y="360" as="sourcePoint"/> + <mxPoint x="463" y="360" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="47" value="Ctrl" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="30" y="200" width="40" height="40" as="geometry"/> + </mxCell> + <mxCell id="48" value="~Ctrl" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="30" y="360" width="40" height="40" as="geometry"/> + </mxCell> + <mxCell id="49" value="" style="endArrow=none;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="47" target="2" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="400" y="470" as="sourcePoint"/> + <mxPoint x="450" y="420" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="50" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="48" target="47" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="82" y="330" as="sourcePoint"/> + <mxPoint x="132" y="280" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="51" value="" style="endArrow=none;html=1;entryX=1;entryY=1;entryDx=0;entryDy=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="5" target="48" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="120" y="500" as="sourcePoint"/> + <mxPoint x="170" y="450" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="55" value="" style="endArrow=none;html=1;" parent="1" source="23" target="89" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="680" y="390" as="sourcePoint"/> + <mxPoint x="660" y="310" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="56" value="$TOP" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="340" y="200" width="40" height="40" as="geometry"/> + </mxCell> + <mxCell id="57" value="$BOT" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="340" y="348.07" width="45" height="45" as="geometry"/> + </mxCell> + <mxCell id="58" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="56" target="2" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="400" y="490" as="sourcePoint"/> + <mxPoint x="450" y="440" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="59" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="5" target="57" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="540" y="710" as="sourcePoint"/> + <mxPoint x="590" y="660" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="61" value="MEM#TOP" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="870" y="145" width="70" height="70" as="geometry"/> + </mxCell> + <mxCell id="62" value="#3" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="870" y="303.85" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="63" value="#4" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="910" y="303.85" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="64" value="#n" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="960" y="303.85" width="50" height="30" as="geometry"/> + </mxCell> + <mxCell id="65" value="" style="endArrow=none;html=1;" parent="1" source="73" target="61" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="850" y="303.85" as="sourcePoint"/> + <mxPoint x="895.9153428657555" y="264.99855603666845" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="66" value="" style="endArrow=none;html=1;" parent="1" source="74" target="73" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="897.322330470336" y="381.1723304703361" as="sourcePoint"/> + <mxPoint x="850" y="333.85" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="67" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="62" target="61" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="990" y="663.85" as="sourcePoint"/> + <mxPoint x="901.5781126951365" y="269.941537193357" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="68" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;" parent="1" source="74" target="62" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="903.1475044241415" y="376.8382225019774" as="sourcePoint"/> + <mxPoint x="950" y="483.85" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="69" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="63" target="61" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="800" y="613.85" as="sourcePoint"/> + <mxPoint x="912.7366063488612" y="273.7473301625265" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="70" value="" style="endArrow=none;html=1;" parent="1" source="74" target="63" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="910" y="430" as="sourcePoint"/> + <mxPoint x="880" y="383.85" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="71" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="64" target="61" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="1040" y="303.85" as="sourcePoint"/> + <mxPoint x="934.0846571342449" y="264.9985560366689" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="72" value="" style="endArrow=none;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;exitX=1;exitY=0;exitDx=0;exitDy=0;" parent="1" source="74" target="64" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="932.677669529664" y="381.1723304703361" as="sourcePoint"/> + <mxPoint x="1020" y="353.85" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="73" value="#2" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="820" y="303.85" width="40" height="30" as="geometry"/> + </mxCell> + <mxCell id="74" value="MEM#BOT" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="870" y="425" width="70" height="70" as="geometry"/> + </mxCell> + <mxCell id="75" value="" style="endArrow=none;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0;exitY=0;exitDx=0;exitDy=0;" parent="1" source="61" target="2" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="1030" y="130" as="sourcePoint"/> + <mxPoint x="1080" y="80" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="76" value="" style="endArrow=none;html=1;entryX=0.219;entryY=0.957;entryDx=0;entryDy=0;entryPerimeter=0;" parent="1" source="5" target="74" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="610" y="640" as="sourcePoint"/> + <mxPoint x="660" y="590" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="79" value="Null" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="450" y="296.15" width="51.92" height="51.92" as="geometry"/> + </mxCell> + <mxCell id="81" value="*void" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="700" y="295.19" width="53.85" height="53.85" as="geometry"/> + </mxCell> + <mxCell id="82" value="" style="endArrow=none;html=1;" parent="1" source="23" target="81" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="540" y="550" as="sourcePoint"/> + <mxPoint x="760" y="310" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="85" value="" style="endArrow=none;html=1;" parent="1" source="23" target="79" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="555" y="340" as="sourcePoint"/> + <mxPoint x="690" y="230" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="87" value="*S1" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="630" y="240" width="38.85" height="38.85" as="geometry"/> + </mxCell> + <mxCell id="88" value="" style="endArrow=none;html=1;" parent="1" source="79" target="89" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="620" y="290" as="sourcePoint"/> + <mxPoint x="650" y="290" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="89" value="*S1?" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="700" y="430" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="90" value="" style="endArrow=none;html=1;" parent="1" source="89" target="87" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="640" y="240" as="sourcePoint"/> + <mxPoint x="690" y="190" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="92" value="*S2" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="540" y="240" width="40" height="40" as="geometry"/> + </mxCell> + <mxCell id="93" value="" style="endArrow=none;html=1;" parent="1" source="22" target="92" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="650" y="70" as="sourcePoint"/> + <mxPoint x="700" y="20" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="94" value="" style="endArrow=none;html=1;" parent="1" source="81" target="92" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="680" y="640" as="sourcePoint"/> + <mxPoint x="730" y="590" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="95" value="" style="endArrow=none;html=1;" parent="1" source="81" target="87" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="650" y="640" as="sourcePoint"/> + <mxPoint x="700" y="590" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="96" value="*S2?" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;" parent="1" vertex="1"> + <mxGeometry x="598.85" y="430" width="50" height="50" as="geometry"/> + </mxCell> + <mxCell id="101" value="" style="endArrow=none;html=1;exitX=0;exitY=0;exitDx=0;exitDy=0;" parent="1" source="96" target="79" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="800" y="760" as="sourcePoint"/> + <mxPoint x="850" y="710" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="102" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="96" target="92" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="730" y="670" as="sourcePoint"/> + <mxPoint x="600" y="240" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="103" value="" style="endArrow=none;html=1;" parent="1" source="23" target="96" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="700" y="530" as="sourcePoint"/> + <mxPoint x="750" y="480" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="104" value="" style="endArrow=none;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;" parent="1" source="81" target="22" edge="1"> + <mxGeometry width="50" height="50" relative="1" as="geometry"> + <mxPoint x="210" y="720" as="sourcePoint"/> + <mxPoint x="610" y="160" as="targetPoint"/> + </mxGeometry> + </mxCell> + <mxCell id="105" value="Control" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="20" y="165" width="60" height="30" as="geometry"/> + </mxCell> + <mxCell id="106" value="Integer" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="140" y="165" width="60" height="30" as="geometry"/> + </mxCell> + <mxCell id="107" value="Struct" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="330" y="165" width="60" height="30" as="geometry"/> + </mxCell> + <mxCell id="108" value="MemPtr" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="580" y="85" width="60" height="30" as="geometry"/> + </mxCell> + <mxCell id="109" value="Mem" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;" parent="1" vertex="1"> + <mxGeometry x="875" y="115" width="60" height="30" as="geometry"/> + </mxCell> + </root> + </mxGraphModel> + </diagram> +</mxfile>
\ No newline at end of file diff --git a/chapter10/docs/lattice.gv b/chapter10/docs/lattice.gv new file mode 100644 index 00000000..406a62c3 --- /dev/null +++ b/chapter10/docs/lattice.gv @@ -0,0 +1,122 @@ +digraph Lattice { + // Define nodes + splines=false; + node [shape=circle, style=filled, fillcolor=lightblue]; + nodesep=0.6; + + TOP [label="⊤"]; + BOT [label="⊥"]; + + CTRL [label="Ctrl"]; + XCTRL [label="~Ctrl"]; + + INT_TOP [label="IntTop"]; + INT_BOT [label="IntBot"]; + + INT_MIN [label="-n"]; + INT_MINDOTS [label="..." shape=none style=none]; + INT_MINUS [label="-1"]; + INT_ZERO [label="0"]; + INT_PLUS [label="1"]; + INT_MAXDOTS [label="..." shape=none style=none]; + INT_MAX [label="+n"]; + + STRUCT_TOP [label="$TOP"]; + STRUCT_S1 [label="S1"]; + STRUCT_S2 [label="S2"]; + STRUCT_BOT [label="$BOT"] + + PTR_TOP [label="*$TOP"]; + PTR_NULL [label="null"]; + PTR_VOIDPTR [label="*void"]; + PTR_S1 [label="*S1"]; + PTR_S2 [label="*S2"]; + PTR_S1OPT [label="*S1?"]; + PTR_S2OPT [label="*S2?"]; + PTR_BOT [label="*$BOT?"]; + + MEM_TOP [label="MEM#TOP"]; + MEM_ALIAS1 [label="#1"]; + MEM_ALIAS2 [label="#2"]; + MEM_ALIASDOTS [label="..." shape=none style=none]; + MEM_ALIASN [label="#n"]; + MEM_BOT [label="MEM#BOT"]; + + // Define edges + edge [arrowhead=none]; + + TOP -> CTRL; + CTRL -> XCTRL; + XCTRL -> BOT; + + TOP -> INT_TOP; + INT_TOP -> INT_MIN; + INT_TOP -> INT_MINDOTS; + INT_TOP -> INT_MINUS; + INT_TOP -> INT_ZERO; + INT_TOP -> INT_PLUS; + INT_TOP -> INT_MAXDOTS; + INT_TOP -> INT_MAX; + INT_MIN -> INT_BOT; + INT_MINDOTS -> INT_BOT; + INT_MINUS -> INT_BOT; + INT_ZERO -> INT_BOT; + INT_PLUS -> INT_BOT; + INT_MAXDOTS -> INT_BOT; + INT_MAX -> INT_BOT; + INT_BOT -> BOT; + + INT_MIN -> INT_MINDOTS -> INT_MINUS -> INT_ZERO -> INT_PLUS -> INT_MAXDOTS -> INT_MAX [style=invis]; + + TOP -> STRUCT_TOP; + STRUCT_TOP -> STRUCT_S1; + STRUCT_TOP -> STRUCT_S2; + STRUCT_S1 -> STRUCT_BOT; + STRUCT_S2 -> STRUCT_BOT; + STRUCT_BOT -> BOT; + + TOP -> PTR_TOP; + PTR_TOP -> PTR_S1; + PTR_TOP -> PTR_S2; + PTR_TOP -> PTR_NULL; + PTR_TOP -> PTR_VOIDPTR; + PTR_NULL -> PTR_BOT; + PTR_NULL -> PTR_S1OPT; + PTR_NULL -> PTR_S2OPT; + PTR_S1 -> PTR_S1OPT; + PTR_S1 -> PTR_VOIDPTR; + PTR_S2 -> PTR_S2OPT; + PTR_S2 -> PTR_VOIDPTR; + PTR_VOIDPTR -> PTR_BOT; + PTR_S1OPT -> PTR_BOT; + PTR_S2OPT -> PTR_BOT; + PTR_BOT -> BOT; + + TOP -> MEM_TOP; + MEM_TOP -> MEM_ALIAS1; + MEM_TOP -> MEM_ALIAS2; + MEM_TOP -> MEM_ALIASDOTS; + MEM_TOP -> MEM_ALIASN; + MEM_ALIAS1 -> MEM_BOT; + MEM_ALIAS2 -> MEM_BOT; + MEM_ALIASDOTS -> MEM_BOT; + MEM_ALIASN -> MEM_BOT; + MEM_BOT -> BOT; + + MEM_ALIAS1 -> MEM_ALIAS2 -> MEM_ALIASDOTS -> MEM_ALIASN [style=invis]; + + // Additional customization + {rank=same; TOP} + {rank=same; INT_TOP; CTRL; STRUCT_TOP; PTR_TOP; MEM_TOP;} + {rank=same; PTR_S1; PTR_S2;} + {rank=same; INT_MIN; INT_MINDOTS; + INT_MINUS; INT_ZERO; + INT_PLUS; INT_MAXDOTS; + INT_MAX; STRUCT_S1; STRUCT_S2; + PTR_NULL; PTR_VOIDPTR; + MEM_ALIAS1; MEM_ALIAS2; + MEM_ALIASDOTS; MEM_ALIASN;} + {rank=same; PTR_S1OPT; PTR_S2OPT;} + {rank=same; INT_BOT; XCTRL; STRUCT_BOT; PTR_BOT; MEM_BOT;} + {rank=same; BOT;} +}
\ No newline at end of file diff --git a/chapter10/docs/lattice.svg b/chapter10/docs/lattice.svg new file mode 100644 index 00000000..5ec4bc16 --- /dev/null +++ b/chapter10/docs/lattice.svg @@ -0,0 +1,460 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<!-- Generated by graphviz version 2.43.0 (0) + --> +<!-- Title: Lattice Pages: 1 --> +<svg width="1512pt" height="745pt" + viewBox="0.00 0.00 1512.20 745.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> +<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 741.25)"> +<title>Lattice</title> +<polygon fill="white" stroke="transparent" points="-4,4 -4,-741.25 1508.2,-741.25 1508.2,4 -4,4"/> +<!-- TOP --> +<g id="node1" class="node"> +<title>TOP</title> +<ellipse fill="lightblue" stroke="black" cx="677.5" cy="-717.76" rx="19.5" ry="19.5"/> +<text text-anchor="middle" x="677.5" y="-714.06" font-family="Times,serif" font-size="14.00">⊤</text> +</g> +<!-- CTRL --> +<g id="node3" class="node"> +<title>CTRL</title> +<ellipse fill="lightblue" stroke="black" cx="53.5" cy="-598.56" rx="28.7" ry="28.7"/> +<text text-anchor="middle" x="53.5" y="-594.86" font-family="Times,serif" font-size="14.00">Ctrl</text> +</g> +<!-- TOP->CTRL --> +<g id="edge1" class="edge"> +<title>TOP->CTRL</title> +<path fill="none" stroke="black" d="M658.48,-713.18C568.82,-696.34 188.15,-624.85 81.42,-604.81"/> +</g> +<!-- INT_TOP --> +<g id="node5" class="node"> +<title>INT_TOP</title> +<ellipse fill="lightblue" stroke="black" cx="326.5" cy="-598.56" rx="40.09" ry="40.09"/> +<text text-anchor="middle" x="326.5" y="-594.86" font-family="Times,serif" font-size="14.00">IntTop</text> +</g> +<!-- TOP->INT_TOP --> +<g id="edge4" class="edge"> +<title>TOP->INT_TOP</title> +<path fill="none" stroke="black" d="M659.12,-710.62C604.04,-692.23 439.49,-637.29 364.5,-612.25"/> +</g> +<!-- STRUCT_TOP --> +<g id="node14" class="node"> +<title>STRUCT_TOP</title> +<ellipse fill="lightblue" stroke="black" cx="677.5" cy="-598.56" rx="36.29" ry="36.29"/> +<text text-anchor="middle" x="677.5" y="-594.86" font-family="Times,serif" font-size="14.00">$TOP</text> +</g> +<!-- TOP->STRUCT_TOP --> +<g id="edge26" class="edge"> +<title>TOP->STRUCT_TOP</title> +<path fill="none" stroke="black" d="M677.5,-698.19C677.5,-681.28 677.5,-655.85 677.5,-635.05"/> +</g> +<!-- PTR_TOP --> +<g id="node18" class="node"> +<title>PTR_TOP</title> +<ellipse fill="lightblue" stroke="black" cx="909.5" cy="-598.56" rx="40.09" ry="40.09"/> +<text text-anchor="middle" x="909.5" y="-594.86" font-family="Times,serif" font-size="14.00">*$TOP</text> +</g> +<!-- TOP->PTR_TOP --> +<g id="edge32" class="edge"> +<title>TOP->PTR_TOP</title> +<path fill="none" stroke="black" d="M694.56,-708.14C732.23,-689.11 823.19,-643.16 873.88,-617.56"/> +</g> +<!-- MEM_TOP --> +<g id="node26" class="node"> +<title>MEM_TOP</title> +<ellipse fill="lightblue" stroke="black" cx="1289.5" cy="-598.56" rx="63.89" ry="63.89"/> +<text text-anchor="middle" x="1289.5" y="-594.86" font-family="Times,serif" font-size="14.00">MEM#TOP</text> +</g> +<!-- TOP->MEM_TOP --> +<g id="edge48" class="edge"> +<title>TOP->MEM_TOP</title> +<path fill="none" stroke="black" d="M696.49,-713.12C776.94,-697.71 1091.76,-637.43 1227.1,-611.51"/> +</g> +<!-- BOT --> +<g id="node2" class="node"> +<title>BOT</title> +<ellipse fill="lightblue" stroke="black" cx="676.5" cy="-19.5" rx="19.5" ry="19.5"/> +<text text-anchor="middle" x="676.5" y="-15.8" font-family="Times,serif" font-size="14.00">⊥</text> +</g> +<!-- XCTRL --> +<g id="node4" class="node"> +<title>XCTRL</title> +<ellipse fill="lightblue" stroke="black" cx="49.5" cy="-138.69" rx="36.29" ry="36.29"/> +<text text-anchor="middle" x="49.5" y="-134.99" font-family="Times,serif" font-size="14.00">~Ctrl</text> +</g> +<!-- CTRL->XCTRL --> +<g id="edge2" class="edge"> +<title>CTRL->XCTRL</title> +<path fill="none" stroke="black" d="M53.25,-569.8C52.55,-489.67 50.59,-264 49.82,-175.22"/> +</g> +<!-- XCTRL->BOT --> +<g id="edge3" class="edge"> +<title>XCTRL->BOT</title> +<path fill="none" stroke="black" d="M85.46,-130.97C202.43,-109.11 569.57,-40.49 657.46,-24.06"/> +</g> +<!-- INT_MIN --> +<g id="node7" class="node"> +<title>INT_MIN</title> +<ellipse fill="lightblue" stroke="black" cx="19.5" cy="-373.83" rx="19.5" ry="19.5"/> +<text text-anchor="middle" x="19.5" y="-370.13" font-family="Times,serif" font-size="14.00">-n</text> +</g> +<!-- INT_TOP->INT_MIN --> +<g id="edge5" class="edge"> +<title>INT_TOP->INT_MIN</title> +<path fill="none" stroke="black" d="M293.93,-574.72C228.5,-526.83 83.24,-420.49 35.23,-385.35"/> +</g> +<!-- INT_MINDOTS --> +<g id="node8" class="node"> +<title>INT_MINDOTS</title> +<text text-anchor="middle" x="108.5" y="-370.13" font-family="Times,serif" font-size="14.00">...</text> +</g> +<!-- INT_TOP->INT_MINDOTS --> +<g id="edge6" class="edge"> +<title>INT_TOP->INT_MINDOTS</title> +<path fill="none" stroke="black" d="M298,-569.18C252.29,-522.07 163.93,-430.97 126.23,-392.11"/> +</g> +<!-- INT_MINUS --> +<g id="node9" class="node"> +<title>INT_MINUS</title> +<ellipse fill="lightblue" stroke="black" cx="197.5" cy="-373.83" rx="19.5" ry="19.5"/> +<text text-anchor="middle" x="197.5" y="-370.13" font-family="Times,serif" font-size="14.00">-1</text> +</g> +<!-- INT_TOP->INT_MINUS --> +<g id="edge7" class="edge"> +<title>INT_TOP->INT_MINUS</title> +<path fill="none" stroke="black" d="M306.34,-563.45C278.21,-514.44 228.26,-427.43 207.25,-390.81"/> +</g> +<!-- INT_ZERO --> +<g id="node10" class="node"> +<title>INT_ZERO</title> +<ellipse fill="lightblue" stroke="black" cx="281.5" cy="-373.83" rx="18" ry="18"/> +<text text-anchor="middle" x="281.5" y="-370.13" font-family="Times,serif" font-size="14.00">0</text> +</g> +<!-- INT_TOP->INT_ZERO --> +<g id="edge8" class="edge"> +<title>INT_TOP->INT_ZERO</title> +<path fill="none" stroke="black" d="M318.56,-558.9C308.69,-509.63 292.28,-427.68 285.08,-391.7"/> +</g> +<!-- INT_PLUS --> +<g id="node11" class="node"> +<title>INT_PLUS</title> +<ellipse fill="lightblue" stroke="black" cx="360.5" cy="-373.83" rx="18" ry="18"/> +<text text-anchor="middle" x="360.5" y="-370.13" font-family="Times,serif" font-size="14.00">1</text> +</g> +<!-- INT_TOP->INT_PLUS --> +<g id="edge9" class="edge"> +<title>INT_TOP->INT_PLUS</title> +<path fill="none" stroke="black" d="M332.54,-558.64C340,-509.33 352.37,-427.55 357.8,-391.65"/> +</g> +<!-- INT_MAXDOTS --> +<g id="node12" class="node"> +<title>INT_MAXDOTS</title> +<text text-anchor="middle" x="448.5" y="-370.13" font-family="Times,serif" font-size="14.00">...</text> +</g> +<!-- INT_TOP->INT_MAXDOTS --> +<g id="edge10" class="edge"> +<title>INT_TOP->INT_MAXDOTS</title> +<path fill="none" stroke="black" d="M345.83,-562.95C372.23,-514.31 418.59,-428.91 438.72,-391.84"/> +</g> +<!-- INT_MAX --> +<g id="node13" class="node"> +<title>INT_MAX</title> +<ellipse fill="lightblue" stroke="black" cx="543.5" cy="-373.83" rx="24.9" ry="24.9"/> +<text text-anchor="middle" x="543.5" y="-370.13" font-family="Times,serif" font-size="14.00">+n</text> +</g> +<!-- INT_TOP->INT_MAX --> +<g id="edge11" class="edge"> +<title>INT_TOP->INT_MAX</title> +<path fill="none" stroke="black" d="M354.87,-569.18C400.48,-521.95 488.77,-430.51 526.13,-391.82"/> +</g> +<!-- INT_BOT --> +<g id="node6" class="node"> +<title>INT_BOT</title> +<ellipse fill="lightblue" stroke="black" cx="326.5" cy="-138.69" rx="40.09" ry="40.09"/> +<text text-anchor="middle" x="326.5" y="-134.99" font-family="Times,serif" font-size="14.00">IntBot</text> +</g> +<!-- INT_BOT->BOT --> +<g id="edge19" class="edge"> +<title>INT_BOT->BOT</title> +<path fill="none" stroke="black" d="M364.62,-124.93C439.56,-99.83 603.55,-44.92 658.3,-26.59"/> +</g> +<!-- INT_MIN->INT_BOT --> +<g id="edge12" class="edge"> +<title>INT_MIN->INT_BOT</title> +<path fill="none" stroke="black" d="M35.14,-361.84C83.16,-325.06 229.13,-213.27 294.38,-163.29"/> +</g> +<!-- INT_MIN->INT_MINDOTS --> +<!-- INT_MINDOTS->INT_BOT --> +<g id="edge13" class="edge"> +<title>INT_MINDOTS->INT_BOT</title> +<path fill="none" stroke="black" d="M125.24,-355.77C162.63,-315.44 253.21,-217.74 299.01,-168.34"/> +</g> +<!-- INT_MINDOTS->INT_MINUS --> +<!-- INT_MINUS->INT_BOT --> +<g id="edge14" class="edge"> +<title>INT_MINUS->INT_BOT</title> +<path fill="none" stroke="black" d="M206.98,-356.54C227.99,-318.25 278.79,-225.65 306.93,-174.37"/> +</g> +<!-- INT_MINUS->INT_ZERO --> +<!-- INT_ZERO->INT_BOT --> +<g id="edge15" class="edge"> +<title>INT_ZERO->INT_BOT</title> +<path fill="none" stroke="black" d="M284.95,-355.77C292.18,-318.02 309.02,-230.01 318.9,-178.39"/> +</g> +<!-- INT_ZERO->INT_PLUS --> +<!-- INT_PLUS->INT_BOT --> +<g id="edge16" class="edge"> +<title>INT_PLUS->INT_BOT</title> +<path fill="none" stroke="black" d="M357.89,-355.77C352.44,-318.13 339.77,-230.51 332.3,-178.83"/> +</g> +<!-- INT_PLUS->INT_MAXDOTS --> +<!-- INT_MAXDOTS->INT_BOT --> +<g id="edge17" class="edge"> +<title>INT_MAXDOTS->INT_BOT</title> +<path fill="none" stroke="black" d="M439.13,-355.77C419.04,-317.05 371.52,-225.46 345.07,-174.49"/> +</g> +<!-- INT_MAXDOTS->INT_MAX --> +<!-- INT_MAX->INT_BOT --> +<g id="edge18" class="edge"> +<title>INT_MAX->INT_BOT</title> +<path fill="none" stroke="black" d="M526.47,-355.38C489.1,-314.89 399.62,-217.93 354.11,-168.61"/> +</g> +<!-- STRUCT_S1 --> +<g id="node15" class="node"> +<title>STRUCT_S1</title> +<ellipse fill="lightblue" stroke="black" cx="633.5" cy="-373.83" rx="23" ry="23"/> +<text text-anchor="middle" x="633.5" y="-370.13" font-family="Times,serif" font-size="14.00">S1</text> +</g> +<!-- STRUCT_TOP->STRUCT_S1 --> +<g id="edge27" class="edge"> +<title>STRUCT_TOP->STRUCT_S1</title> +<path fill="none" stroke="black" d="M670.43,-562.46C661.25,-515.55 645.49,-435.09 637.88,-396.19"/> +</g> +<!-- STRUCT_S2 --> +<g id="node16" class="node"> +<title>STRUCT_S2</title> +<ellipse fill="lightblue" stroke="black" cx="721.5" cy="-373.83" rx="23" ry="23"/> +<text text-anchor="middle" x="721.5" y="-370.13" font-family="Times,serif" font-size="14.00">S2</text> +</g> +<!-- STRUCT_TOP->STRUCT_S2 --> +<g id="edge28" class="edge"> +<title>STRUCT_TOP->STRUCT_S2</title> +<path fill="none" stroke="black" d="M684.57,-562.46C693.75,-515.55 709.5,-435.09 717.12,-396.19"/> +</g> +<!-- STRUCT_BOT --> +<g id="node17" class="node"> +<title>STRUCT_BOT</title> +<ellipse fill="lightblue" stroke="black" cx="676.5" cy="-138.69" rx="36.29" ry="36.29"/> +<text text-anchor="middle" x="676.5" y="-134.99" font-family="Times,serif" font-size="14.00">$BOT</text> +</g> +<!-- STRUCT_S1->STRUCT_BOT --> +<g id="edge29" class="edge"> +<title>STRUCT_S1->STRUCT_BOT</title> +<path fill="none" stroke="black" d="M637.62,-351.28C645.08,-310.47 660.89,-224.05 669.88,-174.89"/> +</g> +<!-- STRUCT_S2->STRUCT_BOT --> +<g id="edge30" class="edge"> +<title>STRUCT_S2->STRUCT_BOT</title> +<path fill="none" stroke="black" d="M717.18,-351.28C709.35,-310.36 692.74,-223.57 683.35,-174.47"/> +</g> +<!-- STRUCT_BOT->BOT --> +<g id="edge31" class="edge"> +<title>STRUCT_BOT->BOT</title> +<path fill="none" stroke="black" d="M676.5,-102.21C676.5,-81.46 676.5,-56.11 676.5,-39.2"/> +</g> +<!-- PTR_NULL --> +<g id="node19" class="node"> +<title>PTR_NULL</title> +<ellipse fill="lightblue" stroke="black" cx="815.5" cy="-373.83" rx="28.7" ry="28.7"/> +<text text-anchor="middle" x="815.5" y="-370.13" font-family="Times,serif" font-size="14.00">null</text> +</g> +<!-- PTR_TOP->PTR_NULL --> +<g id="edge35" class="edge"> +<title>PTR_TOP->PTR_NULL</title> +<path fill="none" stroke="black" d="M893.87,-561.2C874.87,-515.77 843.27,-440.23 826.59,-400.36"/> +</g> +<!-- PTR_VOIDPTR --> +<g id="node20" class="node"> +<title>PTR_VOIDPTR</title> +<ellipse fill="lightblue" stroke="black" cx="1008.5" cy="-373.83" rx="34.39" ry="34.39"/> +<text text-anchor="middle" x="1008.5" y="-370.13" font-family="Times,serif" font-size="14.00">*void</text> +</g> +<!-- PTR_TOP->PTR_VOIDPTR --> +<g id="edge36" class="edge"> +<title>PTR_TOP->PTR_VOIDPTR</title> +<path fill="none" stroke="black" d="M925.85,-561.45C945.01,-517.94 976.45,-446.57 994.53,-405.54"/> +</g> +<!-- PTR_S1 --> +<g id="node21" class="node"> +<title>PTR_S1</title> +<ellipse fill="lightblue" stroke="black" cx="909.5" cy="-471.57" rx="27.1" ry="27.1"/> +<text text-anchor="middle" x="909.5" y="-467.87" font-family="Times,serif" font-size="14.00">*S1</text> +</g> +<!-- PTR_TOP->PTR_S1 --> +<g id="edge33" class="edge"> +<title>PTR_TOP->PTR_S1</title> +<path fill="none" stroke="black" d="M909.5,-558.01C909.5,-538.85 909.5,-516.34 909.5,-499.23"/> +</g> +<!-- PTR_S2 --> +<g id="node22" class="node"> +<title>PTR_S2</title> +<ellipse fill="lightblue" stroke="black" cx="1093.5" cy="-471.57" rx="27.1" ry="27.1"/> +<text text-anchor="middle" x="1093.5" y="-467.87" font-family="Times,serif" font-size="14.00">*S2</text> +</g> +<!-- PTR_TOP->PTR_S2 --> +<g id="edge34" class="edge"> +<title>PTR_TOP->PTR_S2</title> +<path fill="none" stroke="black" d="M942.39,-575.22C979.61,-549.94 1039.19,-509.46 1071.29,-487.66"/> +</g> +<!-- PTR_S1OPT --> +<g id="node23" class="node"> +<title>PTR_S1OPT</title> +<ellipse fill="lightblue" stroke="black" cx="904.5" cy="-270.88" rx="32.49" ry="32.49"/> +<text text-anchor="middle" x="904.5" y="-267.18" font-family="Times,serif" font-size="14.00">*S1?</text> +</g> +<!-- PTR_NULL->PTR_S1OPT --> +<g id="edge38" class="edge"> +<title>PTR_NULL->PTR_S1OPT</title> +<path fill="none" stroke="black" d="M833.94,-351.91C848.3,-335.63 868.24,-313 883.27,-295.96"/> +</g> +<!-- PTR_S2OPT --> +<g id="node24" class="node"> +<title>PTR_S2OPT</title> +<ellipse fill="lightblue" stroke="black" cx="1012.5" cy="-270.88" rx="32.49" ry="32.49"/> +<text text-anchor="middle" x="1012.5" y="-267.18" font-family="Times,serif" font-size="14.00">*S2?</text> +</g> +<!-- PTR_NULL->PTR_S2OPT --> +<g id="edge39" class="edge"> +<title>PTR_NULL->PTR_S2OPT</title> +<path fill="none" stroke="black" d="M840.85,-359.84C877.53,-341.04 945.23,-306.35 983.73,-286.62"/> +</g> +<!-- PTR_BOT --> +<g id="node25" class="node"> +<title>PTR_BOT</title> +<ellipse fill="lightblue" stroke="black" cx="904.5" cy="-138.69" rx="46.29" ry="46.29"/> +<text text-anchor="middle" x="904.5" y="-134.99" font-family="Times,serif" font-size="14.00">*$BOT?</text> +</g> +<!-- PTR_NULL->PTR_BOT --> +<g id="edge37" class="edge"> +<title>PTR_NULL->PTR_BOT</title> +<path fill="none" stroke="black" d="M825.71,-346.85C840.96,-306.56 869.84,-230.25 888.08,-182.07"/> +</g> +<!-- PTR_VOIDPTR->PTR_BOT --> +<g id="edge44" class="edge"> +<title>PTR_VOIDPTR->PTR_BOT</title> +<path fill="none" stroke="black" d="M994.47,-342.11C976.06,-300.5 943.7,-227.32 923.22,-181.01"/> +</g> +<!-- PTR_S1->PTR_VOIDPTR --> +<g id="edge41" class="edge"> +<title>PTR_S1->PTR_VOIDPTR</title> +<path fill="none" stroke="black" d="M929.06,-451.65C944.84,-436.4 967.12,-414.85 984.07,-398.46"/> +</g> +<!-- PTR_S1->PTR_S1OPT --> +<g id="edge40" class="edge"> +<title>PTR_S1->PTR_S1OPT</title> +<path fill="none" stroke="black" d="M908.81,-444.09C907.9,-407.48 906.29,-342.81 905.32,-303.69"/> +</g> +<!-- PTR_S2->PTR_VOIDPTR --> +<g id="edge43" class="edge"> +<title>PTR_S2->PTR_VOIDPTR</title> +<path fill="none" stroke="black" d="M1075.47,-450.27C1062.51,-435.66 1044.94,-415.87 1031.05,-400.22"/> +</g> +<!-- PTR_S2->PTR_S2OPT --> +<g id="edge42" class="edge"> +<title>PTR_S2->PTR_S2OPT</title> +<path fill="none" stroke="black" d="M1083.24,-446.15C1068.34,-409.24 1040.75,-340.89 1024.79,-301.33"/> +</g> +<!-- PTR_S1OPT->PTR_BOT --> +<g id="edge45" class="edge"> +<title>PTR_S1OPT->PTR_BOT</title> +<path fill="none" stroke="black" d="M904.5,-238.37C904.5,-222.41 904.5,-202.75 904.5,-185.19"/> +</g> +<!-- PTR_S2OPT->PTR_BOT --> +<g id="edge46" class="edge"> +<title>PTR_S2OPT->PTR_BOT</title> +<path fill="none" stroke="black" d="M992.18,-245.39C975.69,-225.51 952.2,-197.2 933.69,-174.88"/> +</g> +<!-- PTR_BOT->BOT --> +<g id="edge47" class="edge"> +<title>PTR_BOT->BOT</title> +<path fill="none" stroke="black" d="M863.74,-116.74C813.14,-90.73 729.17,-47.57 693.44,-29.2"/> +</g> +<!-- MEM_ALIAS1 --> +<g id="node27" class="node"> +<title>MEM_ALIAS1</title> +<ellipse fill="lightblue" stroke="black" cx="1197.5" cy="-373.83" rx="24.9" ry="24.9"/> +<text text-anchor="middle" x="1197.5" y="-370.13" font-family="Times,serif" font-size="14.00">#1</text> +</g> +<!-- MEM_TOP->MEM_ALIAS1 --> +<g id="edge49" class="edge"> +<title>MEM_TOP->MEM_ALIAS1</title> +<path fill="none" stroke="black" d="M1265.33,-539.52C1246.21,-492.83 1220.56,-430.15 1206.93,-396.86"/> +</g> +<!-- MEM_ALIAS2 --> +<g id="node28" class="node"> +<title>MEM_ALIAS2</title> +<ellipse fill="lightblue" stroke="black" cx="1289.5" cy="-373.83" rx="24.9" ry="24.9"/> +<text text-anchor="middle" x="1289.5" y="-370.13" font-family="Times,serif" font-size="14.00">#2</text> +</g> +<!-- MEM_TOP->MEM_ALIAS2 --> +<g id="edge50" class="edge"> +<title>MEM_TOP->MEM_ALIAS2</title> +<path fill="none" stroke="black" d="M1289.5,-534.76C1289.5,-489.47 1289.5,-431.15 1289.5,-398.6"/> +</g> +<!-- MEM_ALIASDOTS --> +<g id="node29" class="node"> +<title>MEM_ALIASDOTS</title> +<text text-anchor="middle" x="1384.5" y="-370.13" font-family="Times,serif" font-size="14.00">...</text> +</g> +<!-- MEM_TOP->MEM_ALIASDOTS --> +<g id="edge51" class="edge"> +<title>MEM_TOP->MEM_ALIASDOTS</title> +<path fill="none" stroke="black" d="M1314.33,-539.81C1335.12,-490.65 1363.46,-423.61 1376.87,-391.88"/> +</g> +<!-- MEM_ALIASN --> +<g id="node30" class="node"> +<title>MEM_ALIASN</title> +<ellipse fill="lightblue" stroke="black" cx="1479.5" cy="-373.83" rx="24.9" ry="24.9"/> +<text text-anchor="middle" x="1479.5" y="-370.13" font-family="Times,serif" font-size="14.00">#n</text> +</g> +<!-- MEM_TOP->MEM_ALIASN --> +<g id="edge52" class="edge"> +<title>MEM_TOP->MEM_ALIASN</title> +<path fill="none" stroke="black" d="M1330.73,-549.8C1372.31,-500.61 1434.39,-427.19 1463.43,-392.83"/> +</g> +<!-- MEM_ALIAS1->MEM_ALIAS2 --> +<!-- MEM_BOT --> +<g id="node31" class="node"> +<title>MEM_BOT</title> +<ellipse fill="lightblue" stroke="black" cx="1289.5" cy="-138.69" rx="63.89" ry="63.89"/> +<text text-anchor="middle" x="1289.5" y="-134.99" font-family="Times,serif" font-size="14.00">MEM#BOT</text> +</g> +<!-- MEM_ALIAS1->MEM_BOT --> +<g id="edge53" class="edge"> +<title>MEM_ALIAS1->MEM_BOT</title> +<path fill="none" stroke="black" d="M1206.66,-350.42C1220.43,-315.22 1246.91,-247.53 1266.24,-198.13"/> +</g> +<!-- MEM_ALIAS2->MEM_ALIASDOTS --> +<!-- MEM_ALIAS2->MEM_BOT --> +<g id="edge54" class="edge"> +<title>MEM_ALIAS2->MEM_BOT</title> +<path fill="none" stroke="black" d="M1289.5,-349.11C1289.5,-314.68 1289.5,-251.08 1289.5,-202.78"/> +</g> +<!-- MEM_ALIASDOTS->MEM_ALIASN --> +<!-- MEM_ALIASDOTS->MEM_BOT --> +<g id="edge55" class="edge"> +<title>MEM_ALIASDOTS->MEM_BOT</title> +<path fill="none" stroke="black" d="M1377.2,-355.77C1363.73,-322.43 1334.42,-249.88 1313.39,-197.83"/> +</g> +<!-- MEM_ALIASN->MEM_BOT --> +<g id="edge56" class="edge"> +<title>MEM_ALIASN->MEM_BOT</title> +<path fill="none" stroke="black" d="M1463.95,-354.58C1434.88,-318.61 1371.46,-240.12 1329.63,-188.36"/> +</g> +<!-- MEM_BOT->BOT --> +<g id="edge57" class="edge"> +<title>MEM_BOT->BOT</title> +<path fill="none" stroke="black" d="M1227.06,-125.75C1091.6,-99.86 776.38,-39.59 695.62,-24.15"/> +</g> +</g> +</svg> |
