# Exam question: 31.08.2021 How did we get the step from green to yellow?

+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)?

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.

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

```Constrain(beta2,phi2)
= 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 (170k points)
selected
Yes Professor, this makes more sense. Thank you.