1.1 Propositional Logic 命题逻辑

Propositions 命题

A proposition is a declarative sentence that is either true or false, but not both.
命题是一个对的或者错的陈述句,但不能既是对的又是错的

Definition 定义

  1. 非 not
  2. 与 and
  3. 或 or
  4. 异或 exclusive
  5. 条件语句 onditional statement
  6. 双向条件语句 biconditional statement
T T F T T F T T
T F F F T T F F
F T T F T T T F
F F T F F F T T

Truth Tables of Compound Propositions 复合命题的真值表

Example 11 (P10):
The Truth Table of

T T F T T T
T F T T F F
F T F F F T
F F T T F F

Precedence of Logical Operations 逻辑运算符的优先级

Operator Precedence
1
2
3
4
5

Logic and Bit Operations 逻辑值和位操作

  • Boolean variable 布尔值
  • bit operations 位操作
  • bit string 位串
  • length of a string 位串的长度
  • bitwise OR/AND/XOR 按位与/或/亦或
  • 1 为 true, 0 为 false
1 1 0 1 1 0 1 1
1 0 0 0 1 1 0 0
0 1 1 0 1 1 1 0
0 0 1 0 0 0 1 1

Exercises

  1. Which of these sentences are propositions? What are the truth values of those that are propositions?
    a) Boston is the capital of Massachusetts.
    b) Miami is the capital of Florida.
    d) 5 + 7 = 10.
    e) x + 2 = 11.
    f ) Answer this question.
  2. Let p and q be the propositions
    p: I bought a lottery ticket this week.
    q: I won the million dollar jackpot.
    Express each of these propositions as an English sentence.
    e) p ↔ q
    h) ¬p ∨ (p ∧ q)
  3. Let p, q, and r be the propositions
    p: You get an A on the final exam.
    q: You do every exercise in this book.
    r: You get an A in this class.
    Write these propositions using p, q, and r and logical connectives (including negations).
    d) You get an A on the final, but you don’t do every exercise in this book; nevertheless, you get an A in this
    class.
    e) Getting an A on the final and doing every exercise in this book is sufficient for getting an A in this class.
  4. Determine whether each of these conditional statements is true or false.
    c) If 1 + 1 = 2, then dogs can fly.
  5. Write each of these statements in the form “if p, then q” in English. [Hint: Refer to the list of common ways to express conditional statements provided in this section.]
    a) It is necessary to wash the boss’s car to get promoted.
    b) Winds from the south imply a spring thaw.
    c) A sufficient condition for the warranty to be good is that you bought the computer less than a year ago.
    d) Willy gets caught whenever he cheats.
    e) You can access the website only if you pay a subscription fee.
    f ) Getting elected follows from knowing the right people.
    g) Carol gets seasick whenever she is on a boat.
  6. State the converse, contrapositive, and inverse of each of these conditional statements.
    b) I go to the beach whenever it is a sunny summer day.
  7. Construct a truth table for each of these compound propositions.
    f ) (p ↔ q) ⊕ (p ↔¬q)
  8. The truth value of the conjunction of two propositions in fuzzy logic is the minimum of the truth values of the two propositions. What are the truth values of the statements “Fred and John are happy” and “Neither Fred nor John is happy?”
  9. Is the assertion “This statement is false” a proposition?

你可能感兴趣的:(1.1 Propositional Logic 命题逻辑)