Citizendia
Your Ad Here

For the Wikipedia policy often abbreviated "OR", see Wikipedia:No original research
OR logic gate.
OR logic gate. A logic gate performs a logical operation on one or more logic inputs and produces a single logic output

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. Logic is the study of the principles of valid demonstration and Inference. Mathematics is the body of Knowledge and Academic discipline that studies such concepts as Quantity, Structure, Space and Table of logic symbolsIn Logic, two sentences (either in a formal language or a natural language may be joined by means of a logical connective to form a compound sentence In grammar, or is a coordinating conjunction. Grammar is the field of Linguistics that covers the Rules governing the use of any given natural language.

Contents

Definition

Logical 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. Table of logic symbolsIn Logic, two sentences (either in a formal language or a natural language may be joined by means of a logical connective to form a compound sentence In Logic and Mathematics, a logical value, also called a truth value, is a value indicating the extent to which a Proposition is true In Logic and Philosophy, proposition refers to either (a the content or Meaning of a meaningful Declarative sentence 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 table

The truth table of p OR q (also written as p\orq (logic), p || q (in C-family languages in computer programming), or p + q (electronics)) is as follows:

p q \or
T T T
T F T
F T T
F F F

Venn diagram

The Venn diagram of "p or q" (red is true)

Properties

The following properties apply to disjunction:

(a \land (b \lor c)) \equiv ((a \land b) \lor (a \land c))
(a \lor (b \equiv c)) \equiv ((a \lor b) \equiv (a \lor c))
(a \rightarrow b) \rightarrow ((a \lor c) \rightarrow (b \lor c))

Symbol

The mathematical symbol for logical disjunction varies in the literature. In addition to the word "or", the symbol "\or", deriving from the Latin word vel for "or", is commonly used for disjunction. For example: "A \or B " is read as "A or B ". Such a disjunction is false if both A and B are false. In all other cases it is true.

All of the following are disjunctions:

A \or B
\neg A \or B
A \or \neg B \or \neg C \or D \or \neg E

The corresponding operation in set theory is the set-theoretic union. In Set theory, the term Union (denoted as ∪ refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets

Applications in computer science

Operators corresponding to logical disjunction exist in most programming languages. Programming languages generally support a set of operators that are similar to operators in mathematics. A programming language is an Artificial language that can be used to write programs which control the behavior of a machine particularly a Computer.

Bitwise operation

Disjunction is often used for bitwise operations. Examples:

The or operator can be used to set bits in a bitfield to 1, by or-ing the field with a constant field with the relevant bits set to 1. A bit field is a common idiom used in Computer programming to store a set of Boolean datatype flags compactly as a series of Bits The bit field

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 (|) and logical disjunction with the double pipe (||) operators.

Logical disjunction is usually short-circuited; that is, if the first (left) operand evaluates to true then the second (right) operand is not evaluated. Short-circuit evaluation or minimal evaluation denotes the semantics of some Boolean operators in some Programming languages in which the second argument The logical disjunction operator thus usually constitutes a sequence point. A sequence point in Imperative programming defines any point in a Computer program 's execution at which it is guaranteed that all side effects

Although in most languages the type of a logical disjunction expression is boolean and thus can only have the value true or false, in some (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. Python is a general-purpose High-level programming language. Its design philosophy emphasizes programmer productivity and code readability JavaScript is a Scripting language most often used for Client-side web development

Union

The union used in set theory is defined in terms of a logical disjunction: xAB if and only if (xA) ∨ (xB). In Set theory, the term Union (denoted as ∪ refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets 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. In Logic, De Morgan's laws or De Morgan's theorem are rules in Formal logic relating pairs of dual Logical operators in a systematic manner expressed

Notes

See also

External links

The Logical fallacy of affirming a disjunct also known as the fallacy of the alternative disjunct occurs when a deductive argument takes either of In Computer programming, a bitwise operation operates on one or two Bit patterns or binary numerals at the level of their individual Bits On most Boolean algebra (or Boolean logic) is a logical calculus of truth values, developed by George Boole in the late 1830s This is a list of topics around Boolean algebra and propositional logic. In Mathematics and Abstract algebra, a Boolean domain is a set consisting of exactly two elements whose interpretations include false and In Mathematics, a (finitary Boolean function is a function of the form f: B k &rarr B, where B  = {0 1} A boolean-valued function, in some usages a predicate or a proposition, is a function of the type f: X → B, where X is an arbitrary set A disjunctive syllogism, historically known as Modus tollendo ponens, is a classically valid, simple Argument form: P or Q In Propositional logic disjunction elimination is the inference that if "A or B" is true and A entails C and B entails C then we may justifiably infer C Disjunction introduction or Addition is a valid, simple Argument form in Logic: A First-order logic (FOL is a formal Deductive system used in mathematics philosophy linguistics and computer science A logical graph is a special type of diagramatic structure in any one of several systems of graphical syntax that Charles Sanders Peirce developed for In Logic and Mathematics, a logical value, also called a truth value, is a value indicating the extent to which a Proposition is true In its simplest meaning in Mathematics and Logic, an operation is an action or procedure which produces a new value from one or more input values In Mathematics, an operator is a function which operates on (or modifies another function Symbols There are two symbols for OR gates the 'military' symbol and the 'rectangular' symbol This is a technical mathematical article about the area of mathematical logic variously known as "propositional calculus" or "propositional logic"
© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic