Explore chapters and articles related to this topic
S
Published in Phillip A. Laplante, Dictionary of Computer Science, Engineering, and Technology, 2017
short-circuit evaluation a term applied to the evaluation of Boolean expressions which implies that only as much of the expression needs to be evaluated as will uniquely determine the result. For example, in the expression (A and B), if A evaluates to false, B need not be evaluated at all, since its evaluation will not change the value of the expression. Generally used in programming languages so illegal conditions can be bypassed; for example, “if n is not zero and q divided by n is greater than 5” means that if n is zero, the division will not occur because the conjunction is false. Note that some languages will not short-circuit an evaluation if they detect that there are side effects from the evaluation of later terms. Other languages state that either the side effects are guaranteed to not occur, or that the meaning of the program is undefined because the side effects may or may not occur.
MATLAB Programming
Published in Timothy Bower, ®, 2023
Note that as soon as Matlab determines if a statement is true or false, it stops evaluating. For example, if the logical expression is a && b and a is found to be false, then b is not evaluated because the overall statement will be false. Similarly, if the expression is a || b, b is not evaluated if a is true. This behavior is commonly called short circuit evaluation.
Non-commutative propositional logic with short-circuit evaluation
Published in Journal of Applied Non-Classical Logics, 2021
Jan A. Bergstra, Alban Ponse, Daan J. C. Staudt
Boolean connectives that prescribe short-circuit evaluation often have specific names or notations, for example, Dijkstra's cand (conditional conjunction) and cor used in the three-valued setting with (see Dijkstra, 1976; Gries, 1981), or the short-circuited connectives && and || as used in programming languages such as C, Go, Java, and Perl. Short-circuit evaluation in C is discussed in e.g. Zimmermann and Dold (2003). Other notations for the sequential connectives and with memorising interpretation are ▵ and from computability logic (see, e.g. Japaridze, 2008), and ⊗ and ⊕ from transaction logic (see, e.g. Basseda & Kifer, 2015, there called serial connectives). However, is just a part of both these logics and it is questionable whether its axiomatisation or semantics are of any relevance.
An independent axiomatisation for free short-circuit logic
Published in Journal of Applied Non-Classical Logics, 2018
Alban Ponse, Daan J. C. Staudt
Short-circuit(ed) evaluation denotes the semantics of binary propositional connectives in which the second argument is evaluated only if the first argument does not suffice to determine the value of the expression. In the setting of computer science, connectives that prescribe short-circuit evaluation tend to have specific names or notations, such as Dijkstra’s cand (conditional and) and cor (see Dijkstra, 1976; Gries, 1981), or the short-circuited connectives && and || as used in programming languages such as C, Go, Java and Perl. Short-circuit evaluation in C is discussed in e.g. Zimmermann and Dold (2003), or in a context with partial predicates, in McCarthy (1963).