3 votes 3 votes ((x+y)-((x+y)*(x-y)))+((x+y)*(x-y)) Is this correct DAG for given expression ? Compiler Design compiler-design code-optimization directed-acyclic-graph + – Pawan Kumar 2 asked Nov 2, 2017 • retagged Jun 19, 2022 by Lakshman Bhaiya Pawan Kumar 2 9.5k views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply joshi_nitish commented Nov 2, 2017 reply Follow Share why you have assigned x,y two times. else your DAG is correct. 0 votes 0 votes Pawan Kumar 2 commented Nov 2, 2017 reply Follow Share Sir , one for x-y and other for x+y. Can this purpose be solved using a single x ,y? 0 votes 0 votes joshi_nitish commented Nov 2, 2017 reply Follow Share see this, 2 votes 2 votes Arjun commented Nov 27, 2023 reply Follow Share https://gateoverflow.in/320005/ullman-compiler-design-edition-exercise-question-page-362 0 votes 0 votes Please log in or register to add a comment.
Best answer 6 votes 6 votes Expression:-((x+y)-((x+y)*(x-y)))+((x+y)*(x-y)) LeenSharma answered Nov 2, 2017 • selected Nov 2, 2017 by Pawan Kumar 2 LeenSharma comment Share Follow See all 4 Comments See all 4 4 Comments reply Pawan Kumar 2 commented Nov 2, 2017 reply Follow Share Thank You Sir :) 0 votes 0 votes Kabir5454 commented Jan 3, 2023 reply Follow Share @Deepak Poonia sir here after simplify we get (x+y) . So shouldn’t the DAG just for (x+y) ? 0 votes 0 votes Deepak Poonia commented Jan 3, 2023 reply Follow Share @Kabir5454 We shouldn’t simplify the expression before creating the DAG. Create DAG for the given expression. 0 votes 0 votes Kabir5454 commented Jan 3, 2023 i edited by Kabir5454 Jan 3, 2023 reply Follow Share @Deepak PooniaSir see this question https://gateoverflow.in/95131/dag-compilers here If we make the DAG with or without simplification the answer differ .It is a confusion to minimize the expression before or as i have seen many answers which taken this into considaration to minimize first then draw the graph . 0 votes 0 votes Please log in or register to add a comment.