2 votes 2 votes The minimum number of variables required in 3 address code of the given expression are:______ a * b * c + d - a + e * f - g + h Order of precedence: * > + > - ; with * as left associative and +,- as right associative. Compiler Design compiler-design intermediate-code three-address-code numerical-answers + – Sambhrant Maurya asked Nov 1, 2018 • retagged Jun 23, 2022 by Lakshman Bhaiya Sambhrant Maurya 4.4k views answer comment Share Follow See all 9 Comments See all 9 9 Comments reply Show 6 previous comments Rushikesh0203 commented Dec 1, 2019 reply Follow Share After rules of associativity and precedencce, if we think of last expression as E1 - E2, if we evaluate E1, then answer is 3, but if we evaluate E2 first, we would be getting 2 as the minimum answer. -> explained below. t1 = e*f t1 = t1+a t2 = g+h t2 = t1 - t2 t1 = a*b t1 = t1*c t1 = t1+d t1= t1-t2 Shouldn't minimum answer be 2? Am i doing anything wrong here? 3 votes 3 votes Ram Swaroop commented Jan 24, 2020 reply Follow Share 3 ? 0 votes 0 votes KartikGawande commented Aug 17, 2022 reply Follow Share Sambhrant Maurya because they r not asking for SSA 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes @Sambhrant Mayura The question is asking only about the "MINIMUM number of variables for 3 Address Code". It is NOT asking the "Static Single Assignment" of 3 Address Code. Hence the variables on LHS can be repeated, which cannot be done in Static Single Assignment. You can refer this link. I hope you doubt is clear by now. Hopealways answered Nov 10, 2018 Hopealways comment Share Follow See all 0 reply Please log in or register to add a comment.