The Gateway to Computer Science Excellence
0 votes
13 views

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 Veteran (54.8k points) | 13 views
0

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?

Please log in or register to answer this question.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,422 answers
195,194 comments
99,832 users