Why don't you define switch(s) as you said?
I have an impression that there may be some issues with rounding (can one always distinguish whether a given real number that is a result of a measurement equals 0?), but I don't know anything about your problem.
Also, what is NOR(x)? It can't be the negation of OR because the latter takes two arguments. Is it just negation, i.e., 1 - x?