首页 | 主题 | 图库 | 问答 | 文摘 | 原创 | 百科

历史 | 地理 | 人物 | 艺术 | 体育 | 科学 | 音乐 | 电影 | 信息技术 | 世界遗产

 开放、中立,源自维基百科

Personal tools

Logical connective

From Wikipedia, the free encyclopedia

Jump to: navigation, search

In logic, a logical connective, also called a truth-functional connective, logical operator or propositional operator, is a logical constant which represents a syntactic operation on one or two well formed formulae, or the symbol for such an operation that corresponds to an operation on the logical values of those formulae. A logical connective serves to produce a compound well-formed formula, from one or two well-formed formulae. If all of the variables in a well-formed formula are bound then it is a sentence. If a truth-functional connective is applied to one or two sentences then the results is a compound sentence and the truth-value of the resultant compound sentence is determined by the truth-values(s) of the one or two other sentences. Consequently a logical connective can be seen as a function which when applied to sentences as arguments whose values are True or False returns in turn the value True or False; consequently logical connectives are called truth-functional connectives.

Contents

Introduction

For example the statements, "it is raining," and, "I am indoors", can be reformed using various different connectives to form sentences that relate the two in ways which augment their meaning:

If we write 'P' for 'It is raining' and 'Q' for 'I am indoors' and we use the usual symbols for logical connectives, then the above examples could be represent in symbols like this:

P&Q (It is raining and I am indoors.)
PFailed to parse (Missing texvc executable; please see math/README to configure.): \to

Q (If it is raining then I am indoors.)

QFailed to parse (Missing texvc executable; please see math/README to configure.): \to

P (It is raining if I am indoors.)

PFailed to parse (Missing texvc executable; please see math/README to configure.): \leftrightarrow

Q (It is raining if and only if I am indoors.)

¬P (It is not the case that it is raining.)

The basic logical operators are :

or &)
  • Disjunction (or) (Failed to parse (Missing texvc executable; please see math/README to configure.): \vee

)

, Failed to parse (Missing texvc executable; please see math/README to configure.): \Rightarrow

or Failed to parse (Missing texvc executable; please see math/README to configure.): \supset

)

  • Biconditional (xnor) (Failed to parse (Missing texvc executable; please see math/README to configure.): \leftrightarrow
or Failed to parse (Missing texvc executable; please see math/README to configure.): =

)

  • Identity (Failed to parse (Missing texvc executable; please see math/README to configure.): \equiv

)

Some others are:

)

)

  • Converse nonimplication (Failed to parse (Missing texvc executable; please see math/README to configure.): \not\leftarrow

)

  • Converse implication (Failed to parse (Missing texvc executable; please see math/README to configure.): \leftarrow

)

  • Tautology (Failed to parse (Missing texvc executable; please see math/README to configure.): \top

)

  • Contradiction (Failed to parse (Missing texvc executable; please see math/README to configure.): \bot

)

Definitions

Truth tables

false false false false 0 0 0 0
p AND q = p --\--> ¬q = ¬p <--/-- q = ¬p NOR ¬q 0 0 0 1
p --\--> q = p AND ¬q = ¬p NOR q = ¬p <--/-- ¬q 0 0 1 0
p 0 0 1 1
p <--/-- q = p NOR ¬q = ¬p AND q = ¬p --\--> ¬q 0 1 0 0
q 0 1 0 1
p XOR q = p XNOR ¬q = ¬p XNOR q = ¬p XOR ¬q 0 1 1 0
p OR q = p <----- ¬q = ¬p -----> q = ¬p NAND ¬q 0 1 1 1
p NOR q = p <--/-- ¬q = ¬p --\--> q = ¬p AND ¬q 1 0 0 0
p XNOR q = p XOR ¬q = ¬p XOR q = ¬p XNOR ¬q 1 0 0 1
¬q 1 0 1 0
p <----- q = p OR ¬q = ¬p NAND q = ¬p -----> ¬q 1 0 1 1
¬p 1 1 0 0
p -----> q = p NAND ¬q = ¬p OR q = ¬p <----- ¬q 1 1 0 1
p NAND q = p -----> ¬q = ¬p <----- q = ¬p OR ¬q 1 1 1 0
true true true true 1 1 1 1


Venn diagrams

The binary logical operators may be expressed as Venn diagrams. The red area of each figure corresponds to "true" and the white to "false".

Image:Venn1101.svg
1101: ¬p OR q = p→q
Image:Venn1110.svg
1110: ¬p OR ¬q
Image:Venn1111.svg
1111: tautology
Image:Venn1000.svg
1000: ¬p AND ¬q
Image:Venn1001.svg
1001: p XNOR q
Image:Venn1011.svg
1011: p OR ¬q = p←q
Image:Venn0100.svg
0100: ¬p AND q
Image:Venn0110.svg
0110: p XOR q
Image:Venn0111.svg
0111: p OR q
Image:Venn0000.svg
0000: contradiction
Image:Venn0001.svg
0001: p AND q
Image:Venn0010.svg
0010: p AND ¬q

The above arrangement of Venn Diagrams is from The Geometry of Logic.

Note the similarity between the symbols for "and" (Failed to parse (Missing texvc executable; please see math/README to configure.): \wedge ) and set-theoretic intersection (Failed to parse (Missing texvc executable; please see math/README to configure.): \cap ); likewise for "or" (Failed to parse (Missing texvc executable; please see math/README to configure.): \vee ) and set-theoretic union (Failed to parse (Missing texvc executable; please see math/README to configure.): \cup ). This is not a coincidence: the definition of the intersection uses "and" and the definition of union uses "or".

Functional completeness

Not all of these operators are necessary for a functionally complete logical calculus. Certain compound statements are logically equivalent. For example, ¬PQ is logically equivalent to PQ;. So the conditional operator "→" is not necessary if you have "¬" (not) and "∨" (or).

The smallest set of operators which still expresses every statement which is expressible in the propositional calculus is called a minimal functionally complete set. A minimally complete set of operators is achieved by NAND alone {  } and NOR alone {  }.

The following are the functionally complete sets (of cardinality 2) of operators whose arities do not exceed 2:

{  }, {  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \rightarrowFailed to parse (Missing texvc executable; please see math/README to configure.): \neg  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \rightarrowFailed to parse (Missing texvc executable; please see math/README to configure.): \not\leftrightarrow  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \neg }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \rightarrow }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \veeFailed to parse (Missing texvc executable; please see math/README to configure.): \neg  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \rightarrow }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \neg  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \not\leftrightarrow  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \neg  }, {  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \wedgeFailed to parse (Missing texvc executable; please see math/README to configure.): \neg  }, {  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \botFailed to parse (Missing texvc executable; please see math/README to configure.): \rightarrow  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \leftrightarrow  }, { Failed to parse (Missing texvc executable; please see math/README to configure.): \leftrightarrow  }

Properties

The logical connectives each possess different set of properties which may be expressed in the theorems containing the connective. Some of those properties that a logical connective may have are:

  • Associativity: Within an expression containing two or more of the same associative operators in a row, the order of the operations does not matter as long as the sequence of the operands is not changed.
  • Commutivity: Each pair of variables connected by the operator may be exchanged for each other without affecting the truth-value of the expression.
  • Distributivity:
  • Idempotency:
  • Absorption:

A set of operators is functionally complete if and only if for each of the following five properties it contains at least one member lacking it:

  • monotonic: If f(a1, …, an) ≤ f(b1, …, bn) for all a1, …, an, b1, …, bn ∈ {0,1} such that a1b1, a2b2, …, anbn. E.g., Failed to parse (Missing texvc executable; please see math/README to configure.): \vee

, Failed to parse (Missing texvc executable; please see math/README to configure.): \wedge , Failed to parse (Missing texvc executable; please see math/README to configure.): \top , Failed to parse (Missing texvc executable; please see math/README to configure.): \bot .

  • affine: Each variable always makes a difference in the truth-value of the operation or it never makes a difference. E.g., Failed to parse (Missing texvc executable; please see math/README to configure.): \neg

, Failed to parse (Missing texvc executable; please see math/README to configure.): \leftrightarrow , Failed to parse (Missing texvc executable; please see math/README to configure.): \not\leftrightarrow , Failed to parse (Missing texvc executable; please see math/README to configure.): \top , Failed to parse (Missing texvc executable; please see math/README to configure.): \bot .

  • self dual: To read the truth-value assignments for the operation from top to bottom on its truth table is the same as taking the complement of reading it from bottom to top, in other words fa1, …, ¬an) = ¬f(a1, …, an). E.g., Failed to parse (Missing texvc executable; please see math/README to configure.): \neg

.

  • 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 these operations. E.g., Failed to parse (Missing texvc executable; please see math/README to configure.): \vee

, Failed to parse (Missing texvc executable; please see math/README to configure.): \wedge , Failed to parse (Missing texvc executable; please see math/README to configure.): \top , Failed to parse (Missing texvc executable; please see math/README to configure.): \rightarrow , Failed to parse (Missing texvc executable; please see math/README to configure.): \leftrightarrow , ⊂.

  • 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 these operations. E.g., Failed to parse (Missing texvc executable; please see math/README to configure.): \vee

, Failed to parse (Missing texvc executable; please see math/README to configure.): \wedge , Failed to parse (Missing texvc executable; please see math/README to configure.): \not\leftrightarrow , Failed to parse (Missing texvc executable; please see math/README to configure.): \bot , ⊄, ⊅.

Arity

Main article: arity

In two-valued logic there are 2 nullary operators (constants), 4 unary operators, 16 binary operators, 256 ternary operators, and Failed to parse (Missing texvc executable; please see math/README to configure.): 2^{2^n}

n-ary operators. In three valued logic there are 3 nullary operators (constants), 9 unary operators, 19683 binary operators, 7625597484987 ternary operators, and Failed to parse (Missing texvc executable; please see math/README to configure.): 3^{3^n}
n-ary operators. An n-ary operator in k-valued logic is a function from Failed to parse (Missing texvc executable; please see math/README to configure.): \mathbb{Z}_k^n \to \mathbb{Z}_k

. Therefore the number of such operators is Failed to parse (Missing texvc executable; please see math/README to configure.): |\mathbb{Z}_k|^{|\mathbb{Z}_k^n|} = k^{k^n} , which is how the above numbers were derived.

However, some of the operators of a particular arity are actually degenerate forms that perform a lower-arity operation on some of the inputs and ignores the rest of the inputs. Out of the 256 ternary boolean operators cited above, Failed to parse (Missing texvc executable; please see math/README to configure.): \binom{3}{2}\cdot 16

of them are such degenerate forms of binary or lower-arity operators. The ternary operator Failed to parse (Missing texvc executable; please see math/README to configure.): f(x,y,z)=\lnot x
is one such operator which is actually a unary operator applied to one input, and ignoring the other two inputs.

"Not" is a unary operator, it takes a single term (¬P). The rest are binary operators, taking two terms to make a compound statement (P Failed to parse (Missing texvc executable; please see math/README to configure.): \wedge

Q, P Failed to parse (Missing texvc executable; please see math/README to configure.): \vee
Q, PQ, PQ).

The set of logical operators Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega\!

may be partitioned into disjoint subsets as follows:
Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega = \Omega_0 \cup \Omega_1 \cup \ldots \cup \Omega_j \cup \ldots \cup \Omega_m \,.


In this partition, Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega_j\!

is the set of operator symbols of arity Failed to parse (Missing texvc executable; please see math/README to configure.): j\!

.

In the more familiar propositional calculi, Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega\!

is typically partitioned as follows:
nullary operators: Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega_0 = \{\bot, \top \} \,


unary operators: Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega_1 = \{ \lnot \} \,


binary operators: Failed to parse (Missing texvc executable; please see math/README to configure.): \Omega_2 \subseteq \{ \land, \lor, \rightarrow, \leftrightarrow \} \,


Order of precedence

As a way of reducing the number of necessary parentheses, one may introduce precedence rules: ¬ has higher precedence than ∧, ∧ higher than ∨, and ∨ higher than →. So for example, PQ ∧ ¬RS is short for (P ∨ (Q ∧ (¬R))) → S.

Here is a table that shows the usual precedence of logical operators.

Operator Precedence
¬ 1
Failed to parse (Missing texvc executable; please see math/README to configure.): \wedge 2
Failed to parse (Missing texvc executable; please see math/README to configure.): \vee 3
4
5

The order of precedence determines which connective is the "main connective" when interpreting a molecular formula.

Applications in computer science

Logical operators are implemented as logic gates in digital circuits. Practically all digital circuits (the major exception is DRAM) are built up from NAND, NOR, NOT, and transmission gates. NAND and NOR gates with 3 or more inputs rather than the usual 2 inputs are fairly common, although they are logically equivalent to a cascade of 2-input gates. All other operators are implemented by breaking them down into a logically equivalent combination of 2 or more of the above logic gates.

The "logical equivalence" of "NAND alone", "NOR alone", and "NOT and AND" is similar to Turing equivalence.

Is some new technology (such as reversible computing, clockless logic, or quantum dots computing) "functionally complete", in that it can be used to build computers that can do all the sorts of computation that CMOS-based computers can do? If it can implement the NAND operator, only then is it functionally complete.

That fact that all logical connectives can be expressed with NOR alone is demonstrated by the Apollo guidance computer.

References

See also

da:Logisk operator

de:Boolescher Operator el:Λογικές συναρτήσεις ko:논리 연산 is:Rökaðgerð it:Connettivo logico he:פעולה בוליאנית mk:Логичка операција nl:Booleaanse operator ja:論理演算 pl:Funktor zdaniotwórczy ru:Логическая операция sv:Logisk operator th:ตัวดำเนินการทางตรรกศาสตร์

Languages
AD Links