Logical operators, also known as logical operators (Logical Operators)

Logical Operators

In formal logic, logical operators or logical connectives connect statements into more complex complex statements. For example, given two logical propositions, "It is raining" and "I am inside the house", we can form them into complex propositions "It is raining and I am inside the house" or " It is not raining" or " If it's raining, then I'm inside". A new sentence or proposition composed of two sentences is called a compound sentence or a compound proposition . Also known as Logical Operators.

basic operator

The basic operators are: "Not" (¬), "And" (∧), "Or" (∨), "Condition" (→), and "Double Condition" (↔). "Not" is a unary operator, it only operates on one item (¬P). The rest are binary operators, which operate on two terms to form complex statements (P ∧ Q, P ∨ Q, P → Q, P ↔ Q).

Note the similarity between the symbols "and" (∧) and intersection (∩), "or" (∨) and union (∪). This is no coincidence: intersection is defined using "and", and union is defined using "or".

The truth table for these connectors:

P

Q

¬P

P Q

P Q

PQ

P Q

T

T

F

T

T

T

T

T

F

F

F

T

F

F

F

T

T

F

T

T

F

F

F

T

F

F

T

T

To reduce the number of parentheses needed, the following precedence rules apply: ¬ is higher than ∧, ∧ is higher than ∨, and ∨ is higher than →. For example, P ∨ Q ∧ ¬ R → S is a shorthand for (P ∨ (Q ∧ (¬ R)) → S.

Binary logical connective vocabulary

Below are 16 binary Boolean functions on inputs P and Q.

permanent leave

symbol

Equivalent formula

truth table

Venn diagram

{\displaystyle \bot } {\displaystyle \bot }

P {\displaystyle \wedge } {\displaystyle \wedge } ¬P

Q

0

1

P

0  

 0 

 0 

1  

 0 

 0 

Yongzhen

symbol

Equivalent formula

truth table

Venn diagram

{\displaystyle \top } {\displaystyle \top }

P {\displaystyle \vee } {\displaystyle \vee } ¬P

Q

0

1

P

0  

 1 

 1 

1  

 1 

 1 

conjunction

symbol

Equivalent formula

truth table

Venn diagram

P {\displaystyle \wedge } {\displaystyle \wedge } Q
P & Q
P · Q
P AND Q

P {\displaystyle \not \rightarrow } ̸{\displaystyle \not \rightarrow }→¬Q
¬P
{\displaystyle \not \leftarrow } ̸{\displaystyle \not \leftarrow }← Q
¬P ↓ {\displaystyle \downarrow } ↓{\displaystyle \downarrow }↓ ¬Q

Q

0

1

P

0  

 0 

 0 

1  

 0 

 1 

and non

symbol

Equivalent formula

truth table

Venn diagram

PQ
P | Q
P NAND Q

P → ¬Q
¬PQ
¬P
¬Q

Q

0

1

P

0  

 1 

 1 

1  

 1 

 0 

non-implication

symbol

Equivalent formula

truth table

Venn diagram

P {\displaystyle \not \rightarrow } ̸{\displaystyle \not \rightarrow }→ Q
P
{\displaystyle \not \supset } ̸{\displaystyle \not \supset } Q

P & ¬Q
¬PQ
¬P
{\displaystyle \not \leftarrow } ̸{\displaystyle \not \leftarrow }← ¬Q

Q

0

1

P

0  

 0 

 0 

1  

 1 

 0 

蘊涵

符號

等價公式

真值表

文氏圖

PQ
P
{\displaystyle \supset } {\displaystyle \supset } Q

P ↑ ¬Q
¬P
Q
¬P ← ¬Q

Q

0

1

P

0  

 1 

 1 

1  

 0 

 1 

命題P

符號

等價公式

真值表

文氏圖

P

Q

0

1

P

0  

 0 

 0 

1  

 1 

 1 

非P

符號

等價公式

真值表

文氏圖

¬P
~P

Q

0

1

P

0  

 1 

 1 

1  

 0 

 0 

反非蘊涵

符號

等價公式

真值表

文氏圖

P {\displaystyle \not \leftarrow } ̸{\displaystyle \not \leftarrow }← Q
P
{\displaystyle \not \subset } ̸{\displaystyle \not \subset } Q

P ↓ ¬Q
¬P & Q
¬P
{\displaystyle \not \rightarrow } ̸{\displaystyle \not \rightarrow }→ ¬Q

Q

0

1

P

0  

 0 

 1 

1  

 0 

 0 

反蘊涵

符號

等價公式

真值表

文氏圖

P ← {\displaystyle \leftarrow } ←{\displaystyle \leftarrow }← Q
P {\displaystyle \subset } {\displaystyle \subset } Q

P ¬Q
¬PQ
¬P → ¬Q

Q

0

1

P

0  

 1 

 0 

1  

 1 

 1 

命題Q

符號

等價公式

真值表

文氏圖

Q

Q

0

1

P

0  

 0 

 1 

1  

 0 

 1 

非Q

符號

等價公式

真值表

文氏圖

¬Q
~Q

Q

0

1

P

0  

 1 

 0 

1  

 1 

 0 

異或

符號

等價公式

真值表

文氏圖

P {\displaystyle \not \leftrightarrow } ̸{\displaystyle \not \leftrightarrow } Q
P
{\displaystyle \not \equiv } ̸{\displaystyle \not \equiv }≡ Q
P
{\displaystyle \oplus } {\displaystyle \oplus } Q
P XOR Q

P ¬Q
¬P Q
¬P
{\displaystyle \not \leftrightarrow } ̸{\displaystyle \not \leftrightarrow } ¬Q

Q

0

1

P

0  

 0 

 1 

1  

 1 

 0 

雙條件

符號

等價公式

真值表

文氏圖

P Q
PQ
P XNOR Q
P IFF Q

P {\displaystyle \not \leftrightarrow } ̸{\displaystyle \not \leftrightarrow } ¬Q
¬P
{\displaystyle \not \leftrightarrow } ̸{\displaystyle \not \leftrightarrow } Q
¬P
¬Q

Q

0

1

P

0  

 1 

 0 

1  

 0 

 1 

析取

符號

等價公式

真值表

文氏圖

P Q
P 
 Q
P OR Q

P ← {\displaystyle \leftarrow } ←{\displaystyle \leftarrow }← ¬Q
¬PQ
¬P ↑ ¬Q

Q

0

1

P

0  

 0 

 1 

1  

 1 

 1 

或非

符號

等價公式

真值表

文氏圖

PQ
P NOR Q

P {\displaystyle \not \leftarrow } ̸{\displaystyle \not \leftarrow }← ¬Q
¬P
{\displaystyle \not \rightarrow } ̸{\displaystyle \not \rightarrow }→ Q
¬P
¬Q

Q

0

1

P

0  

 1 

 0 

1  

 0 

 0 

Guess you like

Origin blog.csdn.net/weixin_40191861/article/details/131672910