Logic and proofs(3/5)

1/5, 2/5 講的是proposition logic(命題邏輯),這邊要講predicate logic(述詞邏輯)

主詞,述詞(謂詞),單單只有述詞時是沒有真假的,在說一個特徵。把主詞設為一個變數。

Example.1

Alice is a girl.

  • "Alice" is subject

  • "is a girl" is predicate

P(x) = "x is a girl"

  • P is a proposition function

  • P(x) is the value of the proposition P at x

  • For example, P(Andy) = "Andy is a girl"

  • Note that P(x) is not a proposition

Example.2

Let Q(x, y, z) = "x + y = z"

Q(1, 2, 3) is true.

在陳述一個式子,x + y = z,但在沒有把proposition variable帶進去前他不是proposition

Example.3

Let P(x) = "x > 3"

P(2) is false

p(5) is true

Universal Quantifier

∀x P(x)

all x,

所有, 所有名字開頭都是B

Existential Quantifier

∃x P(x)

有一個x

都可以冠上Demorgan

universal 也同如此。

Practice

存在唯一

∃!x

because 有正負根號2

  • 量詞也符合交換律,也可以把集合拿進去,因為集合的範圍也是個邏輯陳述。

  • 量詞的優先序是最大的。不能用括號來改變他的優先序。

  • 怎麼去理解以下這張圖

  1. 像是9 * 9 雙層迴圈 每一個都要對應到

  2. 像是9 * 9 雙層迴圈隨便一個有就好

注意!! 5 , 6 反過來了,更正下

Last updated

Was this helpful?