theory of computer science
play

Theory of Computer Science B4. Predicate Logic I Gabriele R oger - PowerPoint PPT Presentation

Theory of Computer Science B4. Predicate Logic I Gabriele R oger University of Basel March 9, 2020 Gabriele R oger (University of Basel) Theory of Computer Science March 9, 2020 1 / 40 Theory of Computer Science March 9, 2020 B4.


  1. Theory of Computer Science B4. Predicate Logic I Gabriele R¨ oger University of Basel March 9, 2020 Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 1 / 40

  2. Theory of Computer Science March 9, 2020 — B4. Predicate Logic I B4.1 Motivation B4.2 Syntax of Predicate Logic B4.3 Semantics of Predicate Logic B4.4 Free and Bound Variables B4.5 Summary Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 2 / 40

  3. Logic: Overview Propositional Logic Logic Predicate Logic Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 3 / 40

  4. B4. Predicate Logic I Motivation B4.1 Motivation Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 4 / 40

  5. B4. Predicate Logic I Motivation Limits of Propositional Logic Cannot well be expressed in propositional logic: ◮ “Everyone who does the exercises passes the exam.” ◮ “If someone with administrator privileges presses ‘delete’, all data is gone.” ◮ “Everyone has a mother.” ◮ “If someone is the father of some person, “the person is his child.” ⊲ need more expressive logic ⊲ � predicate logic German: Pr¨ adikatenlogik Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 5 / 40

  6. B4. Predicate Logic I Syntax of Predicate Logic B4.2 Syntax of Predicate Logic Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 6 / 40

  7. B4. Predicate Logic I Syntax of Predicate Logic Logic: Overview Propositional Syntax Logic Semantics Logic Predicate Free Variables Logic Logical Consequence Further Topics Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 7 / 40

  8. B4. Predicate Logic I Syntax of Predicate Logic Syntax: Building Blocks ◮ Signatures define allowed symbols. analogy: variable set A in propositional logic ◮ Terms are associated with objects by the semantics. no analogy in propositional logic ◮ Formulas are associated with truth values (true or false) by the semantics. analogy: formulas in propositional logic German: Signatur, Term, Formel Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 8 / 40

  9. B4. Predicate Logic I Syntax of Predicate Logic Signatures: Definition Definition (Signature) A signature (of predicate logic) is a 4-tuple S = �V , C , F , P� consisting of the following four disjoint sets: ◮ a finite or countable set V of variable symbols ◮ a finite or countable set C of constant symbols ◮ a finite or countable set F of function symbols ◮ a finite or countable set P of predicate symbols (or relation symbols) Every function symbol f ∈ F and predicate symbol P ∈ P has an associated arity ar (f) , ar (P) ∈ N 0 (number of arguments). German: Variablen-, Konstanten-, Funktions-, Pr¨ adikat- und Relationssymbole; Stelligkeit Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 9 / 40

  10. B4. Predicate Logic I Syntax of Predicate Logic Signatures: Terminology and Conventions terminology: ◮ k -ary (function or predicate) symbol: symbol s with arity ar (s) = k . ◮ also: unary, binary, ternary German: k -stellig, un¨ ar, bin¨ ar, tern¨ ar conventions (in this lecture): ◮ variable symbols written in italics , other symbols upright. ◮ predicate symbols begin with capital letter, other symbols with lower-case letters Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 10 / 40

  11. B4. Predicate Logic I Syntax of Predicate Logic Signatures: Examples Example: Arithmetic ◮ V = { x , y , z , x 1 , x 2 , x 3 , . . . } ◮ C = { zero , one } ◮ F = { sum , product } ◮ P = { Positive , SquareNumber } ar (sum) = ar (product) = 2, ar (Positive) = ar (SquareNumber) = 1 Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 11 / 40

  12. B4. Predicate Logic I Syntax of Predicate Logic Signatures: Examples Example: Genealogy ◮ V = { x , y , z , x 1 , x 2 , x 3 , . . . } ◮ C = { roger-federer , lisa-simpson } ◮ F = ∅ ◮ P = { Female , Male , Parent } ar (Female) = ar (Male) = 1, ar (Parent) = 2 Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 12 / 40

  13. B4. Predicate Logic I Syntax of Predicate Logic Terms: Definition Definition (Term) Let S = �V , C , F , P� be a signature. A term (over S ) is inductively constructed according to the following rules: ◮ Every variable symbol v ∈ V is a term. ◮ Every constant symbol c ∈ C is a term. ◮ If t 1 , . . . , t k are terms and f ∈ F is a function symbol with arity k , then f( t 1 , . . . , t k ) is a term. German: Term examples: ◮ x 4 ◮ lisa-simpson ◮ sum( x 3 , product(one , x 5 )) Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 13 / 40

  14. B4. Predicate Logic I Syntax of Predicate Logic Formulas: Definition Definition (Formula) For a signature S = �V , C , F , P� the set of predicate logic formulas (over S ) is inductively defined as follows: ◮ If t 1 , . . . , t k are terms (over S ) and P ∈ P is a k -ary predicate symbol, then the atomic formula (or the atom) P( t 1 , . . . , t k ) is a formula over S . ◮ If t 1 and t 2 are terms (over S ), then the identity ( t 1 = t 2 ) is a formula over S . ◮ If x ∈ V is a variable symbol and ϕ a formula over S , then the universal quantification ∀ x ϕ and the existential quantification ∃ x ϕ are formulas over S . . . . German: atomare Formel, Atom, Identit¨ at, Allquantifizierung, Existenzquantifizierung Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 14 / 40

  15. B4. Predicate Logic I Syntax of Predicate Logic Formulas: Definition Definition (Formula) For a signature S = �V , C , F , P� the set of predicate logic formulas (over S ) is inductively defined as follows: . . . ◮ If ϕ is a formula over S , then so is its negation ¬ ϕ . ◮ If ϕ and ψ are formulas over S , then so are the conjunction ( ϕ ∧ ψ ) and the disjunction ( ϕ ∨ ψ ). German: Negation, Konjunktion, Disjunktion Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 15 / 40

  16. B4. Predicate Logic I Syntax of Predicate Logic Formulas: Examples Examples: Arithmetic and Genealogy ◮ Positive( x 2 ) ◮ ∀ x ( ¬ SquareNumber( x ) ∨ Positive( x )) ◮ ∃ x 3 (SquareNumber( x 3 ) ∧ ¬ Positive( x 3 )) ◮ ∀ x ( x = y ) ◮ ∀ x (sum( x , x ) = product( x , one)) ◮ ∀ x ∃ y (sum( x , y ) = zero) ◮ ∀ x ∃ y (Parent( y , x ) ∧ Female( y )) Terminology: The symbols ∀ and ∃ are called quantifiers. German: Quantoren Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 16 / 40

  17. B4. Predicate Logic I Syntax of Predicate Logic Abbreviations and Placement of Parentheses by Convention abbreviations: ◮ ( ϕ → ψ ) is an abbreviation for ( ¬ ϕ ∨ ψ ). ◮ ( ϕ ↔ ψ ) is an abbreviation for (( ϕ → ψ ) ∧ ( ψ → ϕ )). ◮ Sequences of the same quantifier can be abbreviated. For example: ◮ ∀ x ∀ y ∀ z ϕ � ∀ xyz ϕ ◮ ∃ x ∃ y ∃ z ϕ � ∃ xyz ϕ ◮ ∀ w ∃ x ∃ y ∀ z ϕ � ∀ w ∃ xy ∀ z ϕ placement of parentheses by convention: ◮ analogous to propositional logic ◮ quantifiers ∀ and ∃ bind more strongly than anything else. ◮ example: ∀ x P( x ) → Q( x ) corresponds to ( ∀ x P( x ) → Q( x )), example: not ∀ x (P( x ) → Q( x )). Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 17 / 40

  18. B4. Predicate Logic I Syntax of Predicate Logic Exercise S = �{ x , y , z } , { c } , { f , g , h } , { Q , R , S }� with ar (f) = 3 , ar (g) = ar (h) = 1 , ar (Q) = 2 , ar (R) = ar (S) = 1 ◮ f( x , y ) ◮ (g( x ) = R( y )) ◮ (g( x ) = f( y , c , h( x ))) ◮ (R( x ) ∧ ∀ x S( x )) ◮ ∀ c Q(c , x ) ◮ ( ∀ x ∃ y (g( x ) = y ) ∨ (h( x ) = c)) Which expressions are syntactically correct formulas or terms for S ? What kind of term/formula? Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 18 / 40

  19. B4. Predicate Logic I Semantics of Predicate Logic B4.3 Semantics of Predicate Logic Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 19 / 40

  20. B4. Predicate Logic I Semantics of Predicate Logic Logic: Overview Propositional Syntax Logic Semantics Logic Predicate Free Variables Logic Logical Consequence Further Topics Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 20 / 40

  21. B4. Predicate Logic I Semantics of Predicate Logic Semantics: Motivation ◮ interpretations in propositional logic: truth assignments for the propositional variables ◮ There are no propositional variables in predicate logic. ◮ instead: interpretation determines meaning of the constant, function and predicate symbols. ◮ meaning of variable symbols not determined by interpretation but by separate variable assignment. Gabriele R¨ oger (University of Basel) Theory of Computer Science March 9, 2020 21 / 40

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend