Predicate Logic: Syntax
Alice Gao
Lecture 12
CS 245 Logic and Computation Fall 2019 1 / 30
Predicate Logic: Syntax Alice Gao Lecture 12 CS 245 Logic and - - PowerPoint PPT Presentation
Predicate Logic: Syntax Alice Gao Lecture 12 CS 245 Logic and Computation Fall 2019 1 / 30 Outline Learning goals Symbols Terms Formulas Parse Trees Revisiting the learning goals CS 245 Logic and Computation Fall 2019 2 / 30
CS 245 Logic and Computation Fall 2019 1 / 30
CS 245 Logic and Computation Fall 2019 2 / 30
▶ Defjne the set of terms inductively. ▶ Defjne the set of formulas inductively. ▶ Determine whether a variable in a formula is free or bound. ▶ Prove properties of terms and formulas by structural
▶ Draw the parse tree of a formula.
CS 245 Logic and Computation Fall 2019 3 / 30
▶ Domain: a non-empty set of objects. ▶ Individuals: concrete objects in the domain. ▶ Variables: placeholders for concrete objects in the domain. ▶ Functions: takes objects in the domain as arguments and
▶ Relations: takes objects in the domain as arguments and
▶ Quantifjers: for how many objects in the domain is the
CS 245 Logic and Computation Fall 2019 4 / 30
CS 245 Logic and Computation Fall 2019 5 / 30
▶ Individual symbols: 𝑏, 𝑐, 𝑑. ▶ Relation symbols: 𝐺, 𝐻, 𝐼.
▶ Function symbols: 𝑔, , ℎ. ▶ Free variable symbols: 𝑣, 𝑤, 𝑥. ▶ Bound variable symbols: 𝑦, 𝑧, 𝑨. ▶ Connective symbols: ¬, ∧, ∨, →, ↔. ▶ Quantifjer symbol: ∀, ∃. ▶ Punctuation symbols: ‘(’, ‘)’, and ‘,’
CS 245 Logic and Computation Fall 2019 6 / 30
▶ is bound if it lies in the scope of some quantifjer of the same
▶ is free, otherwise.
CS 245 Logic and Computation Fall 2019 7 / 30
CS 245 Logic and Computation Fall 2019 8 / 30
▶ A term refers to an object in the domain. ▶ A formula evaluates to 1 or 0.
CS 245 Logic and Computation Fall 2019 9 / 30
CS 245 Logic and Computation Fall 2019 10 / 30
▶ 𝑏, 𝑐, 𝑑, 𝑣, 𝑤, 𝑥 ▶ 𝑔(𝑐), (𝑏, 𝑔(𝑐)), (𝑣, 𝑐), 𝑔((𝑔(𝑣), 𝑐))
CS 245 Logic and Computation Fall 2019 11 / 30
CS 245 Logic and Computation Fall 2019 12 / 30
▶ The domain set 𝑌:
▶ The core set 𝐷:
▶ The set of operations 𝑄:
CS 245 Logic and Computation Fall 2019 13 / 30
▶ Base cases:
▶ Inductive cases:
CS 245 Logic and Computation Fall 2019 14 / 30
CS 245 Logic and Computation Fall 2019 15 / 30
▶ If 𝐺 is an n-ary relation symbol and 𝑢1, … , 𝑢𝑜 (𝑜 ≥ 1) are
▶ If 𝑢1, 𝑢2 are terms, then ≈ (𝑢1, 𝑢2) is an atomic formula. ▶ Nothing else is an atomic formula.
CS 245 Logic and Computation Fall 2019 16 / 30
▶ 𝑏, 𝑐, 𝑑, 𝑣, 𝑤, 𝑥 ▶ 𝑔(𝑐), (𝑏, 𝑔(𝑐)), (𝑣, 𝑐), 𝑔((𝑔(𝑣), 𝑐))
▶ 𝐺(𝑏, 𝑣, 𝑔(𝑐), 𝑔(𝑥), (𝑤, 𝑔(𝑏))) ▶ ≈ (𝑐, 𝑥)
CS 245 Logic and Computation Fall 2019 17 / 30
CS 245 Logic and Computation Fall 2019 18 / 30
▶ 𝐵(𝑣) is a well-formed formula where 𝑣 is a free variable in the
▶ In order to do so, we need to choose a symbol for a bound
CS 245 Logic and Computation Fall 2019 19 / 30
▶ We are allowed to generate the formula ∀𝑧𝐺(𝑧, 𝑧).
▶ We are not allowed to generate the formula ∃𝑧∀𝑧𝐺(𝑧, 𝑧).
▶ We are allowed to generate the formula ∃𝑦𝐻(𝑦) ∨ ∀𝑦𝐼(𝑦).
CS 245 Logic and Computation Fall 2019 20 / 30
▶ 𝐺(𝑏, 𝑐), ∀𝑧 𝐺(𝑏, 𝑧), ∃𝑦∀𝑧 𝐺(𝑦, 𝑧) ▶ 𝐺(𝑣, 𝑤), ∃𝑧 𝐺(𝑣, 𝑧)
CS 245 Logic and Computation Fall 2019 21 / 30
CS 245 Logic and Computation Fall 2019 22 / 30
▶ The domain set 𝑌:
▶ The core set 𝐷:
▶ The set of operations 𝑄:
CS 245 Logic and Computation Fall 2019 23 / 30
▶ Base cases:
▶ Inductive cases:
CS 245 Logic and Computation Fall 2019 24 / 30
▶ Which parts of the two defjnitions are the same?
▶ Which parts of the two defjnitions are difgerent?
▶ Atomic propositional formulas are propositional variables. ▶ Atomic predicate formulas are relations applied to terms.
CS 245 Logic and Computation Fall 2019 25 / 30
CS 245 Logic and Computation Fall 2019 26 / 30
▶ The leaves are atomic formulas. ▶ Every quantifjer has exactly one child
CS 245 Logic and Computation Fall 2019 27 / 30
CS 245 Logic and Computation Fall 2019 28 / 30
CS 245 Logic and Computation Fall 2019 29 / 30
▶ Defjne the set of terms inductively. ▶ Defjne the set of formulas inductively. ▶ Determine whether a variable in a formula is free or bound. ▶ Prove properties of terms and formulas by structural
▶ Draw the parse tree of a formula.
CS 245 Logic and Computation Fall 2019 30 / 30