Question
Problem 4(6 points): Each of the following code segments (in Atlas graph language) computes architectural information shown as a graph. For each segment: Show the
Problem 4(6 points): Each of the following code segments (in Atlas graph language) computes architectural information shown as a graph. For each segment:
- Show the result produced by each segment.
- Describe in one or two sentences exactly what is the architectural information computed by the segment.
- Try to find a pattern by performing experiments on two types of functions: (A) functions that contain only one loop, (B) functions that contain multiple loops. Use the pattern to describe how the code segments relate to each other in terms the information they compute.
Segment 1:
var dskenq = functions("dskenq")
var dskenqCFG = cfg(dskenq)
var dskenqLoops = dskenqCFG.nodes(XCSG.Loop)
var loopBody = edges(XCSG.ControlFlow_Edge).between(dskenqLoops,dskenqLoops)
Segment 2:
var kputc = functions("kputc")
var kputcCFG = cfg(kputc)
var kputcLoops = kputcCFG.nodes(XCSG.Loop)
var loopBody = edges(XCSG.ControlFlow_Edge).between(kputcLoops,kputcLoops)
Segment 3:
var kputc = functions("kputc")
var kputcCFG = cfg(kputc)
var kputcLoops = kputcCFG.nodes(XCSG.Loop)
var loopMembers = edges(XCSG.LoopChild).forward(kputcLoops).retainNodes
var loopBody = loopMembers.induce(edges(XCSG.ControlFlow_Edge))
Problem 4(6 points): Each of the following code segments (in Atlas graph language) computes architectural information shown as a graph. For cach segment: 1. 2. Show the result produced by each segment. Describe in one or two sentences exactly what is the architectural information computed by the segment Try to find a pattern by performing experiments on two types of functions: (A) functions that contain only one loop, (B) functions that contain multiple loops. Use the pattern to describe how the code segments relate to each other in terms the information they compute 3. Segment1 var ds kenq = functions ("dskenq") var dskenqCFG-cfg (dskenq) var dake nqLoops = ds kengCFG.nodes (XCSG.Loop) var loopBody edges (XCSG.ControlFlow_Edge).between (dskenqLoops, dskenqLoops) Segment 2: var kputc-functions ("kputc") var kputcCFG-cfg(kputc) var kputcLoopskputcCFG. nodes (XCSG. Loop) var loopBody edges (XCSG.ControlFlow Edge).between (kputcLoops, kputcLoops) Segment 3: var kputc-functions "kputc") var kputcCFG-cig (kputc) var kputcLoopskputcCFG. nodes (XCSG. Loop) var loopMembers edges (XCSG. Loopchild). forward ( kputcLoops, retai nNodes var loopBody loopMembers.induce (edges (XCSG.ControlFlow Edge)) Problem 4(6 points): Each of the following code segments (in Atlas graph language) computes architectural information shown as a graph. For cach segment: 1. 2. Show the result produced by each segment. Describe in one or two sentences exactly what is the architectural information computed by the segment Try to find a pattern by performing experiments on two types of functions: (A) functions that contain only one loop, (B) functions that contain multiple loops. Use the pattern to describe how the code segments relate to each other in terms the information they compute 3. Segment1 var ds kenq = functions ("dskenq") var dskenqCFG-cfg (dskenq) var dake nqLoops = ds kengCFG.nodes (XCSG.Loop) var loopBody edges (XCSG.ControlFlow_Edge).between (dskenqLoops, dskenqLoops) Segment 2: var kputc-functions ("kputc") var kputcCFG-cfg(kputc) var kputcLoopskputcCFG. nodes (XCSG. Loop) var loopBody edges (XCSG.ControlFlow Edge).between (kputcLoops, kputcLoops) Segment 3: var kputc-functions "kputc") var kputcCFG-cig (kputc) var kputcLoopskputcCFG. nodes (XCSG. Loop) var loopMembers edges (XCSG. Loopchild). forward ( kputcLoops, retai nNodes var loopBody loopMembers.induce (edges (XCSG.ControlFlow Edge))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started