int x = 3; int t = 0; while (x

1 answer below »
This is for Project-5My project-4 is not completed fully, but it is the continuation for project-5


int x = 3; int t = 0; while (x < 4)="" {="" int="" y="x;" while="" (y="">< 10)="" {="" y="y" +="" 1;="" t="t" +="" y;="" if="" (t="" %="" 2="=" 0)="" {="" print="" "even";="" }="" else="" {="" print="" "odd";="" }="" }="" x="x" +="" 1;="" }="" -----------rd="" solutions="" entry="" solutions:="" label="" 1:="" {="" (t,="" )="" (x,="" )="" (y,="" )="" }="" label="" 2:="" {="" (t,="" )="" (x,="" 1)="" (y,="" )="" }="" label="" 3:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" }="" label="" 4:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" }="" label="" 5:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 4)="" (y,="" 6)="" }="" label="" 6:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 4)="" (y,="" 6)="" }="" label="" 7:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 8:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 9:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 10:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 11:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 4)="" (y,="" 6)="" }="" label="" 12:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" }="" exit="" solutions:="" label="" 1:="" {="" (t,="" )="" (x,="" 1)="" (y,="" )="" }="" label="" 2:="" {="" (t,="" 2)="" (x,="" 1)="" (y,="" )="" }="" label="" 3:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" }="" label="" 4:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 4)="" }="" label="" 5:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 4)="" (y,="" 6)="" }="" label="" 6:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 7:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 8:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 9:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 10:="" {="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" 6)="" }="" label="" 11:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 11)="" (y,="" 4)="" (y,="" 6)="" }="" label="" 12:="" {="" (t,="" 2)="" (t,="" 7)="" (x,="" 1)="" (x,="" 11)="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" }="" csi="" 5350:="" implementation="" of="" worklist="" algorithm="" this="" project="" is="" a="" continuation="" of="" project="" 4.="" you="" are="" required="" to="" implement="" the="" worklist="" algorithm="" for="" one="" of="" these="" data="" flow="" analyses:="" reaching="" definitions,="" avail-="" able="" expressions,="" live="" variables,="" and="" very="" busy="" expressions.="" you="" may="" complete="" this="" project="" in="" a="" group="" of="" three.="" •="" implement="" the="" worklist="" algorithm="" and="" add="" it="" to="" your="" analyzer;="" •="" test="" your="" analyzer="" with="" a="" suit="" of="" 5="" test="" programs="" in="" myc–;="" and="" •="" submit="" your="" project="" along="" with="" the="" test="" programs="" and="" test="" results.="" 1="" ----------cfg="" label/ast="" map="" verification="" label:="" 1="" stmt:="" int="" x="3" label:="" 2="" stmt:="" int="" t="0" label:="" 3="" stmt:="" while="" ((x="">< 4))="" label:="" 4="" stmt:="" int="" y="x" label:="" 5="" stmt:="" while="" ((y="">< 10)) label: 6 stmt: y = (y + 1) label: 7 stmt: t = (t + y) label: 8 stmt: if (((t % 2) == 0)) label: 9 stmt: print "even" label: 10 stmt: print "odd" label: 11 stmt: x = (x + 1) label: 12 stmt: print t ----------cfg edgemap verification (1,2) (2,3) (3,4) (3,12) (4,5) (5,6) (5,11) (6,7) (7,8) (8,9) (8,10) (9,5) (10,5) (11,3) ----------entry equations rd_entry(1) = { (t, ?) (x, ?) (y, ?) } rd_entry(2) = rd_exit(1) rd_entry(3) = rd_exit(11) u rd_exit(2) rd_entry(4) = rd_exit(3) rd_entry(5) = rd_exit(9) u rd_exit(10) u rd_exit(4) rd_entry(6) = rd_exit(5) rd_entry(7) = rd_exit(6) rd_entry(8) = rd_exit(7) rd_entry(9) = rd_exit(8) rd_entry(10) = rd_exit(8) rd_entry(11) = rd_exit(5) rd_entry(12) = rd_exit(3) ----------exit equations rd_exit(1) = (rd_entry(1) \ { (x, ?) (x, 1) (x, 11) }) u { (x, 1) } rd_exit(2) = (rd_entry(2) \ { (t, ?) (t, 2) (t, 7) }) u { (t, 2) } rd_exit(3) = (rd_entry(3) \ {}) u {} rd_exit(4) = (rd_entry(4) \ { (y, ?) (y, 4) (y, 6) }) u { (y, 4) } rd_exit(5) = (rd_entry(5) \ {}) u {} rd_exit(6) = (rd_entry(6) \ { (y, ?) (y, 4) (y, 6) }) u { (y, 6) } rd_exit(7) = (rd_entry(7) \ { (t, ?) (t, 2) (t, 7) }) u { (t, 7) } rd_exit(8) = (rd_entry(8) \ {}) u {} rd_exit(9) = (rd_entry(9) \ {}) u {} rd_exit(10) = (rd_entry(10) \ {}) u {} rd_exit(11) = (rd_entry(11) \ { (x, ?) (x, 1) (x, 11) }) u { (x, 11) } rd_exit(12) = (rd_entry(12) \ {}) u {} 10))="" label:="" 6="" stmt:="" y="(y" +="" 1)="" label:="" 7="" stmt:="" t="(t" +="" y)="" label:="" 8="" stmt:="" if="" (((t="" %="" 2)="=" 0))="" label:="" 9="" stmt:="" print="" "even"="" label:="" 10="" stmt:="" print="" "odd"="" label:="" 11="" stmt:="" x="(x" +="" 1)="" label:="" 12="" stmt:="" print="" t="" ----------cfg="" edgemap="" verification="" (1,2)="" (2,3)="" (3,4)="" (3,12)="" (4,5)="" (5,6)="" (5,11)="" (6,7)="" (7,8)="" (8,9)="" (8,10)="" (9,5)="" (10,5)="" (11,3)="" ----------entry="" equations="" rd_entry(1)="{" (t,="" )="" (x,="" )="" (y,="" )="" }="" rd_entry(2)="RD_exit(1)" rd_entry(3)="RD_exit(11)" u="" rd_exit(2)="" rd_entry(4)="RD_exit(3)" rd_entry(5)="RD_exit(9)" u="" rd_exit(10)="" u="" rd_exit(4)="" rd_entry(6)="RD_exit(5)" rd_entry(7)="RD_exit(6)" rd_entry(8)="RD_exit(7)" rd_entry(9)="RD_exit(8)" rd_entry(10)="RD_exit(8)" rd_entry(11)="RD_exit(5)" rd_entry(12)="RD_exit(3)" ----------exit="" equations="" rd_exit(1)="(RD_entry(1)" \="" {="" (x,="" )="" (x,="" 1)="" (x,="" 11)="" })="" u="" {="" (x,="" 1)="" }="" rd_exit(2)="(RD_entry(2)" \="" {="" (t,="" )="" (t,="" 2)="" (t,="" 7)="" })="" u="" {="" (t,="" 2)="" }="" rd_exit(3)="(RD_entry(3)" \="" {})="" u="" {}="" rd_exit(4)="(RD_entry(4)" \="" {="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" })="" u="" {="" (y,="" 4)="" }="" rd_exit(5)="(RD_entry(5)" \="" {})="" u="" {}="" rd_exit(6)="(RD_entry(6)" \="" {="" (y,="" )="" (y,="" 4)="" (y,="" 6)="" })="" u="" {="" (y,="" 6)="" }="" rd_exit(7)="(RD_entry(7)" \="" {="" (t,="" )="" (t,="" 2)="" (t,="" 7)="" })="" u="" {="" (t,="" 7)="" }="" rd_exit(8)="(RD_entry(8)" \="" {})="" u="" {}="" rd_exit(9)="(RD_entry(9)" \="" {})="" u="" {}="" rd_exit(10)="(RD_entry(10)" \="" {})="" u="" {}="" rd_exit(11)="(RD_entry(11)" \="" {="" (x,="" )="" (x,="" 1)="" (x,="" 11)="" })="" u="" {="" (x,="" 11)="" }="" rd_exit(12)="(RD_entry(12)" \="" {})="" u="">
Answered 5 days AfterNov 17, 2021

Answer To: int x = 3; int t = 0; while (x

Sandeep Kumar answered on Nov 20 2021
129 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here