snu-sf-class / pl2015spring

SNU 4190.310, 2015 Spring
11 stars 6 forks source link

optimize_0plus_aexp (APlus a1 a2) #125

Open HyeongMee opened 9 years ago

HyeongMee commented 9 years ago

optimize_0plus_aexp (APlus a1 a2) If I apply 'simpl' to here, I thought that the result should be "APlus (opt.. a1)(opt.. a2)" because that's how this function (opt...) is defined. However, when I apply simpl, opt... function suddenly unfolds itself, showing every possible case (a1 destructed, a2 destructed.. etc) I think it's possible to proceed with the unfolded result, but why does 'simpl' work like that here?

Thanks

jaewooklee93 commented 9 years ago

optimize_0plus_aexp (APlus a1 a2) is not the same as APlus (opt.. a1)(opt.. a2). If it is, [ optimize (0+1) ] will be [ optimize (0+1) ]=[ (optimize 0)+(optimize 1) ]=[ 0+1 ]. So that simply means there is no optimization at all.

HyeongMee commented 9 years ago

Oh I can see it right now THX ㅎ