propositional logic
play

Propositional Logic Steffen H olldobler International Center for - PowerPoint PPT Presentation

Propositional Logic Steffen H olldobler International Center for Computational Logic Technische Universit at Dresden Germany Syntax Semantics Equivalence and Normal Forms Proof Procedures Satisfiability Testing


  1. Propositional Logic Steffen H¨ olldobler International Center for Computational Logic Technische Universit¨ at Dresden Germany ◮ Syntax ◮ Semantics ◮ Equivalence and Normal Forms ◮ Proof Procedures ◮ Satisfiability Testing ◮ Properties Steffen H¨ olldobler Propositional Logic 1

  2. Syntax – Formulas ◮ Definition 3.1 An alphabet Σ is a finite or countably infinite set. The elements of this set are called symbols. Without loss of generality (Wlog) we assume that Λ �∈ Σ . ◮ Definition 3.2 Let Σ be an alphabet. The set of words (or strings) over Σ is denoted by Σ ∗ and is the smallest set satisfying the following conditions: 1. Λ ∈ Σ ∗ . 2. If w ∈ Σ ∗ and a ∈ Σ , then aw ∈ Σ ∗ . Λ is called empty word or empty string. ◮ Example Let Σ = { 1 , 2 } . We can form the following words: Λ , 1 Λ , 2 Λ , 11 Λ , 12 Λ , 21 Λ , 22 Λ , 111 Λ , . . . . Steffen H¨ olldobler Propositional Logic 2

  3. The Alphabet of Propositional Logic ◮ Definition 3.3 An alphabet of propositional logic consists of ⊲ a (countably) infinite set R = { p 1 , p 2 , . . . } of propositional variables, ⊲ the set {¬ / 1 , ∧ / 2 , ∨ / 2 , → / 2 , ↔ / 2 } of connectives, and ⊲ the set { ( , ) } of special characters. ◮ Indices are sometimes omitted. ◮ We will occasionally use other letters to denote variables. ◮ Propositional variables are also called nullary relation symbols. ◮ Different alphabets of propositional logic differ in R . Steffen H¨ olldobler Propositional Logic 3

  4. Propositional Formulas ◮ Definition 3.4 A (propositional) atomic formula, briefly called atom, is a propositional variable. ◮ Definition 3.5 Let R be a set of propositional variables. The set of propositional formulas is the smallest set L ( R ) of strings over R , the connectives and the special symbols with the following properties: 1. If F is an atomic formula, then F ∈ L ( R ) . 2. If F ∈ L ( R ) , then ¬ F ∈ L ( R ) . 3. If ◦ / 2 is a binary connective, F , G ∈ L ( R ) , then ( F ◦ G ) ∈ L ( R ) . ◮ Does such a smallest set exist? ⊲ There are sets, which satisfy all properties. ⊲ The intersection of such sets satisfies the properties too. ⊲ The smallest set is the intersection of all sets satisfying the properties. ◮ Notation A (possibly indexed) denotes an atom, F , G , H (possibly indexed) denote propositional formulas. Steffen H¨ olldobler Propositional Logic 4

  5. Structural Induction and Recursion ◮ How can we prove properties of sets of formulas? ◮ Theorem 3.6 (Principle of structural induction) Every propositional formula has a property E , if the following conditions are met: 1. Induction Base: Every atom has property E . 2. Induction Steps: If F has property E , then ¬ F has property E as well. If ◦ / 2 is a binary connective, and F and G have property E , then ( F ◦ G ) has property E as well. ◮ Proof Let E be the set of all formulas satisfying E . ⊲ E ⊆ L ( R ) . ⊲ E satisfies the three conditions of definition 3.5. ⊲ Because L ( R ) is the smallest set satisfying these conditions, L ( R ) ⊆ E must hold. qed Steffen H¨ olldobler Propositional Logic 5

  6. Structural Recursion ◮ How can we define functions acting on formulas? ◮ Theorem 3.7 (Principle of structural recursion) Let M be an arbitrary set and let the following functions be given: ⊲ foo R : R → M , ⊲ foo ¬ : M → M , ⊲ foo ◦ : M × M → M for ◦ ∈ {∧ , ∨ , → , ↔} . Then there is exactly one function foo : L ( R ) → M satisfying the following conditions: 1. Recursion base foo ( A ) = foo R ( A ) for all A ∈ R . 2. Recursion steps foo ( ¬ G ) = foo ¬ ( foo ( G )) for all G ∈ L ( R ) . foo (( G 1 ◦ G 2 )) = foo ◦ ( foo ( G 1 ) , foo ( G 2 )) for all G 1 , G 2 ∈ L ( R ) . ◮ Proof � Exercise Steffen H¨ olldobler Propositional Logic 6

  7. Structural Recursion – Example ◮ M = N . ◮ foo 1 R ( A ) = 0 for all A ∈ R . ◮ foo 1 ¬ ( X ) = X for all X ∈ M . ◮ foo 1 ◦ ( X , Y ) = X + Y + 1 for all ◦ ∈ {∧ , ∨ , → , ↔} and all X , Y ∈ M . ◮ We obtain:  0 if F is an atom,  foo 1 ( F ) = foo 1 ( G ) if F is of the form ¬ G , foo 1 ( G 1 ) + foo 1 ( G 2 ) + 1 if F is of the form ( G 1 ◦ G 2 ) .  ◮ Often foo 1 R , foo 1 ¬ and foo 1 ◦ are not explicitely specified. ◮ foo is a function symbol of a meta language. Steffen H¨ olldobler Propositional Logic 7

  8. Structural Recursion – Another Example ◮ The set of positions or occurrences in F  ∅ if F is an atom,   { 1 π | π ∈ pos ( G ) } if F is of the form ¬ G ,  pos ( F ) = { Λ } ∪ { 1 π 1 | π 1 ∈ pos ( G 1 ) } ∪ { 2 π 2 | π 2 ∈ pos ( G 2 ) }   if F is of the form ( G 1 ◦ G 2 )  Steffen H¨ olldobler Propositional Logic 8

  9. Subformulas ◮ Definition 3.8 Let F ∈ L ( R ) be a propositional formula. The set of subformulas of F is the smallest set of formulas S F satisfying the following conditions: 1. F ∈ S F . 2. If ¬ G ∈ S F , then G ∈ S F . 3. If ( G 1 ◦ G 2 ) ∈ S F , then G 1 , G 2 ∈ S F . The set R F of variables occurring in F is S F ∩ R . G is called subformula of F , if it is in S F . ◮ Example Let F = ¬ (( p 1 → p 2 ) ∨ p 1 ) . S F = {¬ (( p 1 → p 2 ) ∨ p 1 ) , (( p 1 → p 2 ) ∨ p 1 ) , ( p 1 → p 2 ) , p 1 , p 2 } . R F = { p 1 , p 2 } Steffen H¨ olldobler Propositional Logic 9

  10. Semantics ◮ What is the meaning of ¬ (( p 1 → p 2 ) ∨ p 1 ) ? ◮ Here formulas may be true ( ⊤ ) or false ( ⊥ ) � binary logic. Steffen H¨ olldobler Propositional Logic 10

  11. The Structure of the Truth Values ◮ A structure consists of a set of individuals and a set of functions defined on it. ◮ The set of truth values W is the set {⊤ , ⊥} . ◮ Unary functions of type W → W : ⊲ Negation ¬ ∗ : ¬ ∗ ( ⊤ ) = ⊥ and ¬ ∗ ( ⊥ ) = ⊤ . ⊲ Identity. ⊲ Projections onto ⊥ and ⊤ . ◮ Binary functions of type W × W → W : ⊲ Conjunction ∧ ∗ / 2. ⊲ Disjunction ∨ ∗ / 2. ⊲ Implication → ∗ / 2. ⊲ NAND ↑ ∗ / 2. ⊲ NOR ↓ ∗ / 2. ⊲ Equivalence ↔ ∗ / 2. Etc. Steffen H¨ olldobler Propositional Logic 11

  12. The Functions over the Set of Truth Values ∧ ∗ ∨ ∗ → ∗ ← ∗ ∗ ↓ ∗ �→ ∗ �← ∗ ↑ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ⊥ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊥ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ � ∗ � ∗ ↔ ∗ �↔ ∗ ւ ∗ �ւ ∗ ց ∗ �ց ∗ ⊤ ⊤ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊤ ⊥ ⊥ ⊤ ⊤ ⊥ ⊥ ⊥ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ◮ Here negation, conjunction, disjunction, implication, equivalence. Steffen H¨ olldobler Propositional Logic 12

  13. Interpretations ◮ Definition 3.9 A (propositional) interpretation I = ( W , · I ) consists of the set W and a mapping · I : L ( R ) → W which meets the following conditions: � ¬ ∗ [ G ] I if F is of the form ¬ G , [ F ] I = ([ G 1 ] I ◦ ∗ [ G 2 ] I ) if F is of the form ( G 1 ◦ G 2 ) . ◮ An interpretation I = ( W , · I ) is uniquely defined by specifying how · I acts on propositional variables. ◮ Recall that A denotes an atom. ◮ We will sometimes identify an interpretation I = ( W , · I ) with { A | [ A ] I = ⊤} . ◮ We often write F I instead of [ F ] I . ◮ I (possibly indexed) denotes an interpretation. Steffen H¨ olldobler Propositional Logic 13

  14. Satisfiability of Formulas ◮ Definition 3.12 Let F ∈ L ( R ) . ⊲ F is called satisfiable if there is an interpretation I = ( W , · I ) with F I = ⊤ . ⊲ F is called valid (or F is a tautology) if for all interpretations I = ( W , · I ) we have: F I = ⊤ . ⊲ F is called falsifiable if there is an interpretation I = ( W , · I ) with F I = ⊥ . ⊲ F is called unsatisfiable if for all interpretations I = ( W , · I ) we have: F I = ⊥ . Steffen H¨ olldobler Propositional Logic 14

  15. Truth Tables ◮ How can we compute the value of a formula F under all possible interpretations? ◮ Computing a truth table: 1 Let m = |S F | be the number of subformulas of F . 2 Let n = |R F | 3 Form a table with 2 n rows and m columns, where the first n columns are marked by the n propositional variables occurring in F , the last column is marked by F , and the remaining columns are marked by the other subformulas of F . 4 Fill in the first n columns with ⊤ und ⊥ as follows: In the first column fill in alternating downwards ⊤⊥⊤⊥ . . . , in the second column ⊤⊤⊥⊥ . . . , in the third column ⊤⊤⊤⊤⊥⊥⊥⊥ . . . , etc. 5 Calculate the values in the remaining columns using the known functions on the set of truth values. Steffen H¨ olldobler Propositional Logic 15

  16. Working with Truth Tables ◮ Let F be a formula and T ( F ) a corresponding truth table. Then: ⊲ F is satisfiable iff T ( F ) contains a row with ⊤ in the last column. ⊲ F is valid iff all rows in T ( F ) have ⊤ in the last column. ⊲ F is falsifiable iff T ( F ) contains a row with ⊥ in the final column. ⊲ F is unsatisfiable iff all rows T ( F ) have ⊥ in the final column. Steffen H¨ olldobler Propositional Logic 16

  17. Models ◮ Definition 3.13 An interpretation I = ( W , · I ) is called model for a propositional = F , if F I = ⊤ . formula F , in symbols I | ◮ Abbreviations ⊲ If I is not a model for the formula F , i. e. if F I = ⊥ , then we write I �| = F . ⊲ If F is valid, then we write | = F . Steffen H¨ olldobler Propositional Logic 17

Recommend


More recommend