Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

Problem 4(6 points): Each of the following code segments (in Atlas graph language) computes architectural information shown as a graph. For each segment:

  1. Show the result produced by each segment.
  2. Describe in one or two sentences exactly what is the architectural information computed by the segment.
  3. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the conceptual basis for CSR?

Answered: 1 week ago

Question

Write Hund's rule?

Answered: 1 week ago

Question

Types of Interpersonal Relationships?

Answered: 1 week ago

Question

Self-Disclosure and Interpersonal Relationships?

Answered: 1 week ago