Predicate Logic: Semantics
Alice Gao
Lecture 13
CS 245 Logic and Computation Fall 2019 1 / 36
Predicate Logic: Semantics Alice Gao Lecture 13 CS 245 Logic and - - PowerPoint PPT Presentation
Predicate Logic: Semantics Alice Gao Lecture 13 CS 245 Logic and Computation Fall 2019 1 / 36 Outline The Learning Goals Evaluating Terms and Formulas w/o Variables Evaluating Terms and Formulas w/o Bound Variables Evaluating Quantifjed
CS 245 Logic and Computation Fall 2019 1 / 36
CS 245 Logic and Computation Fall 2019 2 / 36
▶ Defjne a valuation. ▶ Determine the value of a term given a valuation. ▶ Determine the truth value of a formula given a valuation. ▶ Give a valuation that makes a formula true or false. ▶ Determine and justify whether a formula is satisfjable and/or
CS 245 Logic and Computation Fall 2019 3 / 36
▶ Domain: a non-empty set of objects ▶ Individuals: concrete objects in the domain ▶ Functions: takes objects in the domain as arguments and
▶ Relations: takes objects in the domain as arguments and
▶ Variables: placeholders for concrete objects in the domain ▶ Quantifjers: for how many objects in the domain is the
CS 245 Logic and Computation Fall 2019 4 / 36
CS 245 Logic and Computation Fall 2019 5 / 36
CS 245 Logic and Computation Fall 2019 6 / 36
▶ Any 𝑛-tuple (𝑒1, ..., 𝑒𝑛) ∈ 𝐸𝑛 can be an input to 𝑔𝑤. ▶ For any legal 𝑛-tuple (𝑒1, ..., 𝑒𝑛) ∈ 𝐸𝑛,
1, ..., 𝑒𝑤 𝑛) ∈ 𝐸.
CS 245 Logic and Computation Fall 2019 7 / 36
CS 245 Logic and Computation Fall 2019 8 / 36
1, … , 𝑢𝑤 𝑜).
CS 245 Logic and Computation Fall 2019 9 / 36
1 = 3, 𝑣𝑤 2 = 3, 𝑣𝑤 3 = 1. 𝐸 = {1, 2, 3}.
1
2
1
2
3
1
2
1
2
3
CS 245 Logic and Computation Fall 2019 10 / 36
1, … , 𝑢𝑤 𝑜⟩ ∈ 𝐺 𝑤.
CS 245 Logic and Computation Fall 2019 11 / 36
CS 245 Logic and Computation Fall 2019 12 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Individuals: 𝑏𝑤 = 1, 𝑐𝑤 = 2, 𝑑𝑤 = 3. ▶ Free variables: 𝑣𝑤 = 3, 𝑤𝑤 = 2, 𝑥𝑤 = 1. ▶ Functions:
▶ Relations:
CS 245 Logic and Computation Fall 2019 13 / 36
▶ Domain: 𝐸 = {𝐵𝑚𝑗𝑑𝑓, 𝐶𝑝𝑐, 𝐷𝑏𝑢𝑓}. ▶ Individuals: 𝑏𝑤 = 𝐵𝑚𝑗𝑑𝑓, 𝑐𝑤 = 𝐶𝑝𝑐, 𝑑𝑤 = 𝐷𝑏𝑢𝑓. ▶ Free variables: 𝑣𝑤 = 𝐶𝑝𝑐, 𝑤𝑤 = 𝐵𝑚𝑗𝑑𝑓, 𝑥𝑤 = 𝐵𝑚𝑗𝑑𝑓. ▶ Functions:
▶ Relations:
CS 245 Logic and Computation Fall 2019 14 / 36
▶ 𝑔𝑤 is the identify function. 𝑔𝑤(𝑦) = 𝑦. ▶ 𝑔𝑤(1) = 1, 𝑔𝑤(2) = 2 and 𝑔𝑤(3) = 3.
▶ 𝐻𝑤: 𝐻𝑤(𝑦, 𝑧) is true if and only if 𝑦 > 𝑧. ▶ 𝐻𝑤 = {⟨2, 1⟩, ⟨3, 1⟩, ⟨3, 2⟩}
CS 245 Logic and Computation Fall 2019 15 / 36
CS 245 Logic and Computation Fall 2019 16 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Individuals: 𝑏𝑤 = 1, 𝑐𝑤 = 2, 𝑑𝑤 = 3. ▶ Free variables: 𝑣𝑤 = 3, 𝑤𝑤 = 2, 𝑥𝑤 = 1. ▶ Functions:
▶ Relations:
CS 245 Logic and Computation Fall 2019 17 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Individuals: 𝑏𝑤 = ?, 𝑐𝑤 = ?, 𝑑𝑤 = ?. ▶ Functions: 𝑔𝑤 ∶ ?, 𝑤 ∶ ? ▶ Relations: 𝑄 𝑤 ∶ ?, 𝐻𝑤 ∶ ?
CS 245 Logic and Computation Fall 2019 18 / 36
CS 245 Logic and Computation Fall 2019 19 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Individuals: 𝑏𝑤 = 1, 𝑐𝑤 = 2, 𝑑𝑤 = 3. ▶ Free variables: 𝑣𝑤 = 3, 𝑤𝑤 = 2, 𝑥𝑤 = 1. ▶ Functions:
▶ Relations:
CS 245 Logic and Computation Fall 2019 20 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Individuals: 𝑏𝑤 = 1, 𝑐𝑤 = 2, 𝑑𝑤 = 3. ▶ Free variables: 𝑣𝑤 = 3, 𝑤𝑤 = 2, 𝑥𝑤 = 1. ▶ Functions:
▶ Relations:
CS 245 Logic and Computation Fall 2019 21 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Individuals: 𝑏𝑤 = ?, 𝑐𝑤 = ?, 𝑑𝑤 = ?. ▶ Free variables: 𝑣𝑤 = ?, 𝑣𝑤 = ? 𝑣𝑤 = ?. ▶ Functions: 𝑔𝑤 ∶ ?, 𝑤 ∶ ? ▶ Relations: 𝑄 𝑤 ∶ ?, 𝐻𝑤 ∶ ?
CS 245 Logic and Computation Fall 2019 22 / 36
CS 245 Logic and Computation Fall 2019 23 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ Relations: 𝐻𝑤 = {⟨1, 2⟩, ⟨3, 1⟩, ⟨2, 3⟩}.
CS 245 Logic and Computation Fall 2019 24 / 36
CS 245 Logic and Computation Fall 2019 25 / 36
▶ Domain: 𝐸 = {1, 2, 3}. ▶ ...
CS 245 Logic and Computation Fall 2019 26 / 36
CS 245 Logic and Computation Fall 2019 27 / 36
▶ 𝑀(𝑏)
▶ 𝑀(𝑣)
CS 245 Logic and Computation Fall 2019 28 / 36
▶ 𝑣 + 𝑣 = 𝑤
▶ ∀𝑦 ∀𝑧 (𝑦 + 𝑦 = 𝑧)
CS 245 Logic and Computation Fall 2019 29 / 36
CS 245 Logic and Computation Fall 2019 30 / 36
CS 245 Logic and Computation Fall 2019 31 / 36
CS 245 Logic and Computation Fall 2019 32 / 36
▶ Determine whether the formula is valid or not. ▶ How do I prove that a formula is NOT valid?
▶ How do I prove that a formula is valid?
CS 245 Logic and Computation Fall 2019 33 / 36
CS 245 Logic and Computation Fall 2019 34 / 36
▶ 𝐸 = {1, 2} ▶ 𝐺 𝑤 = {1}
CS 245 Logic and Computation Fall 2019 35 / 36
▶ Defjne a valuation. ▶ Determine the value of a term given a valuation. ▶ Determine the truth value of a formula given a valuation. ▶ Give a valuation that makes a formula true or false. ▶ Determine and justify whether a formula is satisfjable and/or
CS 245 Logic and Computation Fall 2019 36 / 36