Reasoning about non-determinism in programs