
Understanding CFG Nodes and Information Loss in Program Semantics
Explore the concept of Control Flow Graph (CFG) nodes and information loss in program semantics. Learn how nodes store constant values and how imprecise information at one point can lead to the loss of other crucial data, impacting program understanding.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
m1 l(m1, n) ESSSD[s, m1] m2 l(m2, n) n ESSSD[s, m2] s . . . l(mk, n) ESSSD[s, mk] mk
1: start .(???) 2: a=1 . [a 1] 3: b=1 . [b 1] . [c (a)+ (b)] F 4: a<3 6: c=a+b 7: exit . (a)>=3? : . (a)<3? : T 5: a=a+b
node 1 2 3 4 5 6 7 iteration 0 {(???)} 1 Store {(???)} {(1??)} 2 Store {(???)} {(1??)} {(11?)} 3 Store {(???)} {(1??)} {(11?)} (11?) (21?) (11?) (21?) {(11?)} 4 Store {(???)} {(1??)} {(11?)} 5 Store (11?) (21?) {(???)} {(1??)} 6 Store (11?) (21?) (31?) (11?) (21?) {(???)} {(1??)} 7 Store (11?) (21?) (31?) (11?) (21?) {(31?)} {(???)} {(1??)} 8 Store (11?) (21?) (31?) (11?) (21?) {(31?)} {(???)} {(1??)} {(314)} 9 Store (11?) (21?) (31?) (11?) (21?) {(31?)} {(???)} {(1??)} {(314)} 10 Store means that the indicated variable has a constant value at a node in the CFG. For example, variable b has the constant value 1 at node 4. (Note that we also treat ? as a constant.)
node 1 2 3 4 5 6 7 iteration 0 1 Store [ ] {(???)} [???] 2 Store [ ] {(???)} [???] {(1??)} [1??] 3 Store [ ] {(???)} [???] {(1??)} [1??] {(11?)} [11?] 4 Store [ ] {(???)} [???] {(1??)} [1??] {(11?)} [11?] {(11?)} [11?] (11?) (21?) [ 1?] (11?) (21?) [ 1?] 5 Store [ ] {(???)} [???] {(1??)} [1??] {(11?)} [11?] (11?) (21?) [ 1?] 6 Store [ ] {(???)} [???] {(1??)} [1??] (11?) (21?) (31?) [ 1?] (11?) (21?) [ 1?] 7 Store [ ] {(???)} [???] {(1??)} [1??] (11?) (21?) (31?) [ 1?] (11?) (21?) [ 1?] 8 Store [ ] {(???)} [???] {(1??)} [1??] {(31?)} [ 1?] (11?) (21?) (31?) [ 1?] (11?) (21?) [ 1?] 9 Store [ ] {(???)} [???] {(1??)} [1??] {(31?)} [ 1?] {(314)} [ 1 ] (11?) (21?) (31?) [ 1?] (11?) (21?) [ 1?] 10 Store [ ] {(???)} [???] {(1??)} [1??] {(31?)} [ 1?] {(314)} [ 1 ] shows places where we obtain worse information than what the collecting semantics indicates. The loss of information at one point can cause other information to be lost (e.g., variable c at point 7, due to imprecise information for variable a at point 6).