All Topics  
Logical disjunction

 

   Email Print
   Bookmark   Link






 

Logical disjunction



 
 
]]

In logic
Logic

Logic is the study of the principles of valid demonstration and inference. Logic is a branch of philosophy, a part of the classical Trivium . The word derives from Greek language ?????? , fem....
 and mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, 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. E.g. in this context A or B is true if
If

If is a conjunction meaning "in the event that" or "in the case of".If is a Most common words in English used in the Protasis of a conditional sentence and the antecedent of a proposition....
 A, B or both A and B are true. In grammar
Grammar

Grammar is the field of linguistics that covers the conventions governing the use of any given natural language. It includes morphology and syntax, often complemented by phonetics, phonology, semantics, and pragmatics....
, or is a coordinating conjunction
Grammatical conjunction

In grammar, a conjunction is a part of speech that connects two words, phrases or clauses together. This definition may overlap with that of other parts of speech, so what constitutes a "conjunction" should be defined for each language....
. In ordinary language "or" sometimes has the meaning of exclusive disjunction
Exclusive disjunction

The Logical connective exclusive disjunction, also called exclusive or , is a type of logical disjunction on two operands that results in a value of true if and only if exactly one of the operands has a value of true....
.

Definition
Logical disjunction is an operation on two logical value
Logical value

In logic and mathematics, a logical value, also called a truth value, is a value indicating the extent to which a proposition is truth.In classical logic, the only possible truth values are true and false....
s, typically the values of two proposition
Proposition

This article is about the term proposition in logic and philosophy; for other uses see PropositionIn logic and philosophy, proposition refers to either the "content" or Meaning of a meaningful declarative sentence or the pattern of symbols, marks, or sounds that make up a meaningful declarative sentence....
s, that produces a value of false if and only if both of its operands are false.






Discussion
Ask a question about 'Logical disjunction'
Start a new discussion about 'Logical disjunction'
Answer questions from other users
Full Discussion Forum



Recent Posts









Encyclopedia


]]

In logic
Logic

Logic is the study of the principles of valid demonstration and inference. Logic is a branch of philosophy, a part of the classical Trivium . The word derives from Greek language ?????? , fem....
 and mathematics
Mathematics

Mathematics is the study of quantity, structure, space, change, and related topics of pattern and form. Mathematicians seek out patterns whether found in numbers, space, natural science, computers, imaginary abstractions, or elsewhere....
, 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. E.g. in this context A or B is true if
If

If is a conjunction meaning "in the event that" or "in the case of".If is a Most common words in English used in the Protasis of a conditional sentence and the antecedent of a proposition....
 A, B or both A and B are true. In grammar
Grammar

Grammar is the field of linguistics that covers the conventions governing the use of any given natural language. It includes morphology and syntax, often complemented by phonetics, phonology, semantics, and pragmatics....
, or is a coordinating conjunction
Grammatical conjunction

In grammar, a conjunction is a part of speech that connects two words, phrases or clauses together. This definition may overlap with that of other parts of speech, so what constitutes a "conjunction" should be defined for each language....
. In ordinary language "or" sometimes has the meaning of exclusive disjunction
Exclusive disjunction

The Logical connective exclusive disjunction, also called exclusive or , is a type of logical disjunction on two operands that results in a value of true if and only if exactly one of the operands has a value of true....
.

Definition


Logical disjunction is an operation on two logical value
Logical value

In logic and mathematics, a logical value, also called a truth value, is a value indicating the extent to which a proposition is truth.In classical logic, the only possible truth values are true and false....
s, typically the values of two proposition
Proposition

This article is about the term proposition in logic and philosophy; for other uses see PropositionIn logic and philosophy, proposition refers to either the "content" or Meaning of a meaningful declarative sentence or the pattern of symbols, marks, or sounds that make up a meaningful declarative sentence....
s, 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 literal
Literal

Literal may refer to:*Literal and figurative language, taken in a non-figurative sense.*Literal translation, the close adherence to the forms of a source language text....
s separated only by ORs. A single literal is often considered to be a degenerate disjunction.

Truth table

The truth table
Truth table

A truth table is a mathematical table used in logic?specifically in connection with Boolean algebra , boolean functions, and propositional calculus?to compute the functional values of logical expression s on each of their functional arguments, that is, on each combination of values taken by their logical variables....
 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 diagram

The Venn diagram
Venn diagram

Venn diagrams or set diagrams are diagrams that show all hypothetically possible logical relations between a finite collection of Set . Venn diagrams were invented around 1880 by John Venn....
 of "p or q" (red is true)

Properties


The following properties apply to disjunction:

  • associativity
    Associativity

    In mathematics, associativity is a property that a binary operation can have. It means that, within an expression containing two or more of the same associative operators in a row, the order that the operations are performed does not matter as long as the sequence of the operands is not changed....
    :


  • commutativity
    Commutativity

    In mathematics, commutativity is the process to change the order of something without changing the end result. It is a fundamental property of many binary operations throughout mathematics, and many Mathematical proof depend on it....
    :


  • distributivity
    Distributivity

    In mathematics, and in particular in abstract algebra, distributivity is a property of binary operations that generalises the distributive law from elementary algebra....
    :


  • 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.


Symbol

The mathematical symbol for logical disjunction varies in the literature. In addition to the word "or", the symbol "", deriving from the Latin word vel for "or", is commonly used for disjunction. For example: "A 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:


The corresponding operation in set theory is the set-theoretic union
Union (set theory)

In set theory, the term Union 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
Operator (programming)

Programming languages generally support a set of operators that are similar to operator. A language may contain a fixed number of built-in operators or it may allow the creation of programmer-defined operators ....
 corresponding to logical disjunction exist in most programming language
Programming language

A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
s.

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 bitfield to 1, by or-ing the field with a constant field with the relevant bits set to 1.

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. The logical disjunction operator thus usually constitutes a sequence point
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 effect s of previous evaluations will have been performed, and no side effects from subsequent evaluations have yet been performed....
.

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
JavaScript

JavaScript is a scripting language widely used for client-side web development. It was the originating Programming language dialect of the ECMAScript standard....
) the logical disjunction operator returns one of its operands; the first operand if it evaluates to a true value, and the second operand otherwise.

Union

The union
Union (set theory)

In set theory, the term Union refers to a set operation used in the convergence of set elements to form a resultant set containing the elements of both sets....
 used in set theory
Set theory

Set theory is the branch of mathematics that studies Set , which are collections of objects. Although any type of object can be collected into a set, set theory is applied most often to objects that are relevant to mathematics....
 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
De Morgan's laws

In formal logic, De Morgan's laws are rules relating the logical operators 'and' and 'or' in terms of each other via logical negation.History...
.

See also

  • Exclusive disjunction
    Exclusive disjunction

    The Logical connective exclusive disjunction, also called exclusive or , is a type of logical disjunction on two operands that results in a value of true if and only if exactly one of the operands has a value of true....
  • Affirming a disjunct
    Affirming a disjunct

    The logical fallacy of affirming a disjunct also known as the fallacy of the alternative disjunct occurs when a deductive logic argument takes either of the two following formal logic:...
  • Bitwise OR
    Bitwise operation

    In computer programming, a bitwise operation operates on one or two bit patterns or Binary numeral system at the level of their individual bits....
  • Boolean algebra (logic)
  • Boolean algebra topics
  • Boolean domain
    Boolean domain

    In mathematics and abstract algebra, a Boolean domain is a Set consisting of exactly two elements whose interpretations include false and true....
  • Boolean function
    Boolean function

    In mathematics, a Boolean function is a function of the form f : Bk ? B, where B =  is a Boolean domain and k is a nonnegative integer called the arity of the function....
  • Boolean-valued function
    Boolean-valued function

    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 and where B is a boolean domain....
  • Disjunctive syllogism
    Disjunctive syllogism

    A disjunctive syllogism, historically known as modus tollendo ponens, is a classical logic validity, simple argument form:Roughly speaking, we are told that at least one of two statements is true; then we are told that it is not the former that is true; so we infer that it has to be the latter that is true....
  • Disjunction elimination
    Disjunction elimination

    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
    Disjunction introduction

    Disjunction introduction or Addition is a validity, simple argument form in logic:or in logical operator notation:The argument form has one premise, A, and an unrelated proposition, B....
  • First-order logic
    First-order logic

    First-order logic is a formal deductive system used in mathematics, philosophy, linguistics, and computer science. It goes by many names, including: first-order predicate calculus , the lower predicate calculus, the language of first-order logic or predicate logic....
  • Logical graph
    Logical graph

    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 logic....
  • Logical value
    Logical value

    In logic and mathematics, a logical value, also called a truth value, is a value indicating the extent to which a proposition is truth.In classical logic, the only possible truth values are true and false....
  • Operation
    Operation (mathematics)

    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....
  • Operator
    Operator

    In mathematics, an operator is a function which operates on another function. Often, an "operator" is a function which acts on functions to produce other functions ; or it may be a generalization of such a function, as in linear algebra, where some of the terminology reflects the origin of the subject in operations on the functions which ar...
  • OR gate
    OR gate

    The OR gate is a digital logic gate that implements logical disjunction - it behaves according to the truth table to the right. A HIGH output results if one or both the inputs to the gate are HIGH ....
  • Propositional calculus
    Propositional calculus

    In logic and mathematics, a propositional calculus or logic is a formal system in which formulae representing propositional formulas can be formed by combining atomic formula propositions using logical connectives, and a system of formal proof rules allows certain formul? to be established as "theorem"....


External links