in Compiler Design
4,702 views
0 votes
0 votes

Construct the DAG and identify the value numbers for the subexpressions of the following expressions, assuming $+$ associates from the left.

  1. $a+b+(a+b)$
  2. $a+b+a+b$
  3. $a+a+((a+a+a+(a+a+a+a))$ 
in Compiler Design
by
4.7k views

1 comment

for part (b)  :  a + b + a + b

DAG is :

and Value number table will be:

  1         ID       a  
  2         ID        b  
  3         +        1        2

from this we conclude that :

the value number of + is 3 and its left child has 1 and right child has 2

Is this correct value number table and DAG for (b)? correct me if i am wrong?

0
0

1 Answer

1 vote
1 vote

Solution Manual for this Exercise :

https://github.com/fool2fish/dragon-book-exercise-answers/blob/master/ch06/6.1/6.1.md

Note : If language is not English then Right click on page then click on “ Translate to English “

Related questions