Logical disjunction
of \scriptstyle A \lor B \lor C In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as ∨ and read aloud as "or".
≈ 6 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
of \scriptstyle A \lor B \lor C In logic, disjunction (also known as logical disjunction, logical or, logical addition, or inclusive disjunction) is a logical connective typically notated as ∨ and read aloud as "or". For instance, the English language sentence "it is sunny or it is warm" can be represented in logic using the disjunctive formula ∨ , assuming that abbreviates "it is sunny" and abbreviates "it is warm".
In classical logic, disjunction is given a truth functional semantics according to which a formula \phi \lor \psi is true unless both \phi and \psi are false. Because this semantics allows a disjunctive formula to be true when both of its disjuncts are true, it is an inclusive interpretation of disjunction, in contrast with exclusive disjunction.
Classical proof theoretical treatments are often given in terms of rules such as disjunction introduction and disjunction elimination. Disjunction has also been given numerous non-classical treatments, motivated by problems including Aristotle's sea battle argument, Heisenberg's uncertainty principle, as well as the numerous mismatches between classical disjunction and its nearest equivalents in natural languages.
An operand of a disjunction is a disjunct.
Inclusive and exclusive disjunction
Because the logical or means a disjunction formula is true when either one or both of its parts are true, it is referred to as an inclusive disjunction. This is in contrast with an exclusive disjunction, which is true when one or the other of the arguments is true, but not both (referred to as exclusive or, or XOR).
When it is necessary to clarify whether inclusive or exclusive or is intended, English speakers sometimes use the phrase and/or. In terms of logic, this phrase is identical to or, but makes the inclusion of both being true explicit.
Notation
In logic and related fields, disjunction is customarily notated with an infix operator ∨ (Unicode ). Alternative notations include +, used mainly in electronics, as well as and in many programming languages. The English word or is sometimes used as well, often in capital letters.
In Jan Łukasiewicz's prefix notation for logic, the operator is , short for Polish alternatywa (English: alternative). In mathematics, the disjunction of an arbitrary number of elements a_1, \ldots, a_n can be denoted as an iterated binary operation using a larger ⋁ (Unicode ): \bigvee_{i=1}^{n} a_i = a_1 \lor a_2 \lor \ldots a_{n-1} \lor a_{n}
Defined by other operators
In classical logic systems where logical disjunction is not a primitive, it can be defined in terms of the primitive and (∧) and not (¬) as: ∨ = ¬((¬ ) ∧ (¬ )) . Alternatively, it may be defined in terms of implies ( \to ) and not as: ∨ = (¬ ) → . The latter can be checked by the following truth table: It may also be defined solely in terms of \to : A \lor B = (A \to B) \to B . It can be checked by the following truth table:
Properties
The following properties apply to disjunction: Associativity: ∨ ( ∨ ) ≡ ( ∨ ) ∨ Commutativity: ∨ ≡ ∨ Distributivity: ( ∧ ( ∨ )) ≡ (( ∧ ) ∨ ( ∧ )) ( ∨ ( ∧ )) ≡ (( ∨ ) ∧ ( ∨ )) ( ∨ ( ∨ )) ≡ (( ∨ ) ∨ ( ∨ )) ( ∨ ( ≡ )) ≡ (( ∨ ) ≡ ( ∨ )) Idempotency: ∨ ≡ Monotonicity: ( → ) → (( ∨ ) → ( ∨ )) ( → ) → (( ∨ ) → ( ∨ )) Truth-preserving: The interpretation under which all variables are assigned a truth value of 'true', produces a truth value of 'true' as a result of disjunction. Falsehood-preserving: The interpretation under which all variables are assigned a truth value of 'false', produces a truth value of 'false' as a result of disjunction.
Applications in computer science
Operators corresponding to logical disjunction exist in most programming languages.
Bitwise operation
Disjunction is often used for bitwise operations. Examples: 0 or 0 = 0 0 or 1 = 1 1 or 0 = 1 1 or 1 = 1 1010 or 1100 = 1110 The or operator can be used to set bits in a bit field to 1, by or -ing the field with a constant field with the relevant bits set to 1. For example, x = x | 0b00000001 will force the final bit to 1, while leaving other bits unchanged.
Logical operation
Many languages distinguish between bitwise and logical disjunction by providing two distinct operators; in languages following C, bitwise disjunction is performed with the single pipe operator ( | ), and logical disjunction with the double pipe ( || ) operator. Logical disjunction is usually short-circuited; that is, if the first (left) operand evaluates to true , then the second (right) operand is not evaluated.
The logical disjunction operator thus usually constitutes a sequence point. In a parallel (concurrent) language, it is possible to short-circuit both sides: they are evaluated in parallel, and if one terminates with value true, the other is interrupted. This operator is thus called the parallel or.
Although the type of a logical disjunction expression is Boolean in most languages (and thus can only have the value true or false ), in some languages (such as Python and JavaScript), the logical disjunction operator returns one of its operands: the first operand if it evaluates to a true value, and the second operand otherwise. This allows it to fulfill the role of the Elvis operator.
Constructive disjunction
The Curry–Howard correspondence relates a constructivist form of disjunction to tagged union types.
Set theory
The membership of an element of a union set in set theory is defined in terms of a logical disjunction: x\in A\cup B\Leftrightarrow (x\in A)\vee(x\in B) . Because of this, logical disjunction satisfies many of the same identities as set-theoretic union, such as associativity, commutativity, distributivity, and de Morgan's laws, identifying logical conjunction with set intersection, logical negation with set complement.
See also
Affirming a disjunct Boolean algebra (logic) Boolean algebra topics Boolean domain Boolean function Boolean-valued function Conjunction/disjunction duality Disjunctive syllogism Fréchet inequalities Free choice inference Hurford disjunction Logical graph Simplification of disjunctive antecedents
Notes
George Boole, closely following analogy with ordinary mathematics, premised, as a necessary condition to the definition of x + y, that x and y were mutually exclusive. Jevons, and practically all mathematical logicians after him, advocated, on various grounds, the definition of logical addition in a form that does not necessitate mutual exclusiveness.
External links
Eric W. Weisstein. "Disjunction." From MathWorld—A Wolfram Web Resource
Text derived from https://en.wikipedia.org/w/index.php?oldid=1369489365 under CC BY-SA 4.0; modifications have been made.