Here you can ask questions and find or give answers to organizational, academic and other questions about studying computer science.

1.1k questions

1.2k answers


546 users

+1 vote

In the first screen shot, How did we get the step from green to yellow , considering that the second (blue highlighted) rule in the second screen shot better fits the step (since low of node is 0)?

in * TF "Emb. Sys. and Rob." by (480 points)
I see that you like the rewrite rules better than the algorithm. Nice to see, that I have made them for some purpose.
Yes, Professor, the rewrite rules are much easier to use than the algorithms. Thank you for those!
Same here, find rewrite rules much easier to understand.
The example solution has been adapted accordingly. Thanks for pointing this out.

1 Answer

+3 votes
Best answer

I agree that the solution is weird even though the result is correct. This one is a better solution: 

    = Constrain((a?beta4:beta3),(a?true:phi3))
    = (a ? Constrain(beta4,true) : Constrain(beta3,phi3))
    = (a ? true : Constrain(beta3,phi3))
    = (a ? true : Constrain((b?true:beta5),phi3))
    = (a ? true : (b ? Constrain(true,phi3) : Constrain(beta5,phi3) ))
    = (a ? true : (b ? phi3 : Constrain(beta5,phi3) ))
    = (a ? true : (b ? phi3 : Constrain((c?true:false),(c?false:true)) ))
    = (a ? true : (b ? phi3 : Constrain(true,false) ))
    = (a ? true : (b ? phi3 : false ))
Do you agree with this one?
by (166k points)
selected by
Yes Professor, this makes more sense. Thank you.
Imprint | Privacy Policy