|
||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
"Either or" redirects here. For the philosophical work by Søren Kierkegaard, see Either/Or. For other uses, see Or (disambiguation).
For the Wikipedia policy often abbreviated "OR", see Wikipedia:No original research
OR logic gate.
This audio file was created from a revision dated 2006-07-21, and does not reflect subsequent edits to the article. (Audio help)
In logic and mathematics, or, also known as logical disjunction or inclusive disjunction is a logical operator that results in true whenever one or more of its operands are true. In grammar, or is a coordinating conjunction. In ordinary language "or" rather has the meaning of exclusive disjunction.
DefinitionLogical disjunction is an operation on two logical values, typically the values of two propositions, that produces a value of false if and only if both of its operands are false. More generally a disjunction is a logical formula that can have one or more literals separated only by ORs. A single literal is often considered to be a degenerate disjunction. Truth tableThe truth table of p OR q (also written as p∨q (logic), p || q (in C-family languages in computer programming), or p + q (electronics)) is as follows:
Venn diagramThe Venn diagram of "p or q" (red is true) PropertiesThe following properties apply to disjunction:
SymbolThe mathematical symbol for logical disjunction varies in the literature. In addition to the word "or", the symbol " All of the following are disjunctions: The corresponding operation in set theory is the set-theoretic union. Applications in computer scienceOperators corresponding to logical disjunction exist in most programming languages. Bitwise operationDisjunction is often used for bitwise operations. Examples:
The Logical operationMany languages distinguish between bitwise and logical disjunction by providing two distinct operators; in languages following C, bitwise disjunction is performed with the single pipe ( Logical disjunction is usually short-circuited; that is, if the first (left) operand evaluates to Although in most languages the type of a logical disjunction expression is boolean and thus can only have the value UnionThe union used in set theory is defined in terms of a logical disjunction: x ∈ A ∪ B if and only if (x ∈ A) ∨ (x ∈ 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. Notes
See alsoExternal links
|
||||||||||||||||||||||||||||||||||||||||||||
| All Right Reserved © 2007, Designed by Stylish Blog. |