Short-circuit evaluation
= Short-circuit evaluation
Evaluation that skips a later operand once an earlier operand determines the result. In <Scala>, `p != null && p.field == x` does not dereference `p` when it is null, and `i < n && a(i) != x` avoids an out-of-range access at $i=n$. The order is part of the safety argument: exchanging these operands can preserve a Boolean formula in mathematics while changing whether a program raises an exception.