edited by
446 views
0 votes
0 votes
For question like :-

Find minimum number of variable required to solve the expression in three address code. (not SSA)

Do we need to consider the given variable also?

Example:-

q + r/3 + s – t * 5 + u * v/w

how many variable required?
edited by

1 Answer

1 votes
1 votes
((q +( r/3)) + s) – ((t * 5 )+( u * (v/w)))

t1 = v/w;

t1=t1*u;

t2 = t*5;

t2 = t2+t1;

t3 = r/3;

t3 = t3+q;

t3 = t3+s;

t3  = t3-t2;

so  , 3 variables needed.

Related questions

0 votes
0 votes
0 answers
2
2 votes
2 votes
1 answer
4