logic as a tool chapter 4 deductive reasoning in first
play

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic - PowerPoint PPT Presentation

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.4 Prenex normal form. Skolemization. Clausal form. Valentin Goranko Stockholm University October 2016 Goranko Revision: CNF and DNF of propositional formulae A literal


  1. Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.4 Prenex normal form. Skolemization. Clausal form. Valentin Goranko Stockholm University October 2016 Goranko

  2. Revision: CNF and DNF of propositional formulae • A literal is a propositional variable or its negation. • An elementary disjunction is a disjunction of literals. An elementary conjunction is a conjunction of literals. • A disjunctive normal form (DNF) is a disjunction of elementary conjunctions. • A conjunctive normal form (CNF) is a conjunction of elementary disjunctions. Goranko

  3. Conjunctive and disjunctive normal forms of first-order formulae An open first-order formula is in disjunctive normal form (resp., conjunctive normal form) if it is a first-order instance of a propositional formula in DNF (resp. CNF), obtained by uniform substitution of atomic formulae for propositional variables. Examples: ( ¬ P ( x ) ∨ Q ( x , y )) ∧ ( P ( x ) ∨ ¬ R ( y )) is in CNF, as it is a first-order instance of ( ¬ p ∨ q ) ∧ ( p ∨ ¬ r ); ( P ( x ) ∧ Q ( x , y ) ∧ R ( y )) ∨ ¬ P ( x ) is in DNF, as it is a first-order instance of ( ¬ p ∧ q ∧ r ) ∨ ¬ p . ∀ xP ( x ) ∨ Q ( x , y ) and ¬ P ( x ) ∨ ( Q ( x , y ) ∧ R ( y )) ∧ ¬ R ( y ) are not in either CNF or DNF. Goranko

  4. Prenex normal forms A first-order formula Q 1 x 1 ... Q n x n A , where Q 1 , ..., Q n are quantifiers and A is an open formula, is in a prenex form. The quantifier string Q 1 x 1 ... Q n x n is called the prefix, and the formula A is the matrix of the prenex form. Examples: ∀ x ∃ y ( x > 0 → ( y > 0 ∧ x = y 2 )) is in prenex form, while ∃ x ( x = 0 ) ∧ ∃ y ( y < 0 ) and ∀ x ( x > 0 ∨ ∃ y ( y > 0 ∧ x = y 2 )) are not in prenex form. Goranko

  5. Prenex conjunctive and disjunctive normal forms If A is in DNF then Q 1 x 1 ... Q n x n A is in prenex disjunctive normal form (PDNF); if A is in CNF then Q 1 x 1 ... Q n x n A is in prenex conjunctive normal form (PCNF). Examples: ∀ x ∃ y ( ¬ x > 0 ∨ y > 0 ) is both in PDNF and in PCNF. ∀ x ∃ y ( ¬ x > 0 ∨ ( y > 0 ∧ ¬ x = y 2 )) is in PDNF, but not in PCNF. ∀ x ∀ y ( ¬ P ( x ) ∨ ( Q ( x , y ) ∧ R ( y )) ∧ ¬ R ( y )) is neither in PCNF nor in PDNF. Goranko

  6. Transformation to prenex normal forms THEOREM: Every first-order formula is equivalent to a formula in a prenex disjunctive normal form (PDNF) and to a formula in a prenex conjunctive normal form (PCNF). Here is an algorithmic procedure: 1. Eliminate all occurrences of → and ↔ . 2. Import all negations inside all other logical connectives. 3. Use the equivalences: ( a ) ∀ xP ∧ ∀ xQ ≡ ∀ x ( P ∧ Q ) , ( b ) ∃ xP ∨ ∃ xQ ≡ ∃ x ( P ∨ Q ) , to pull some quantifiers outwards and, after renaming one of the bound variables if necessary. Goranko

  7. Transformation to prenex normal forms cont’d 4. To pull all quantifiers in front of the formula and thus transform it into a prenex form, use the following equivalences, where x is not free in Q : (c) ∀ xP ∧ Q ≡ Q ∧ ∀ xP ≡ ∀ x ( P ∧ Q ), (d) ∀ xP ∨ Q ≡ Q ∨ ∀ xP ≡ ∀ x ( P ∨ Q ), (e) ∃ xP ∨ Q ≡ Q ∨ ∃ xP ≡ ∃ x ( P ∨ Q ), (f) ∃ xP ∧ Q ≡ Q ∧ ∃ xP ≡ ∃ x ( P ∧ Q ), If necessary, use renaming in order to apply these. Example: ∀ xP ( x ) ∧ ∃ xQ ( x ) ≡ ∀ x ( P ( x ) ∧ ∃ xQ ( x )) ≡ ∀ x ( P ( x ) ∧ ∃ yQ ( y )) ≡ ∀ x ∃ y ( P ( x ) ∧ Q ( y )). Better: ∀ xP ( x ) ∧ ∃ xQ ( x ) ≡ ∃ x ( ∀ xP ( x ) ∧ Q ( x )) ≡ ∃ x ( ∀ yP ( y ) ∧ Q ( x )) ≡ ∃ x ∀ y ( P ( y ) ∧ Q ( x )). 5. Finally, transform the matrix in a DNF or CNF, just like a propositional formula. Goranko

  8. Transformation to prenex normal forms: example A = ∃ z ( ∃ xQ ( x , z ) ∨ ∃ xP ( x )) → ¬ ( ¬∃ xP ( x ) ∧ ∀ x ∃ zQ ( z , x )). 1. Eliminating → : A ≡ ¬∃ z ( ∃ xQ ( x , z ) ∨ ∃ xP ( x )) ∨ ¬ ( ¬∃ xP ( x ) ∧ ∀ x ∃ zQ ( z , x )) 2. Importing the negation: A ≡ ∀ z ( ¬∃ xQ ( x , z ) ∧ ¬∃ xP ( x )) ∨ ( ¬¬∃ xP ( x ) ∨ ¬∀ x ∃ zQ ( z , x )) ≡ ∀ z ( ∀ x ¬ Q ( x , z ) ∧ ∀ x ¬ P ( x )) ∨ ( ∃ xP ( x ) ∨ ∃ x ∀ z ¬ Q ( z , x )). 3. Using the equivalences (a) and (b): A ≡ ∀ z ∀ x ( ¬ Q ( x , z ) ∧ ¬ P ( x )) ∨ ∃ x ( P ( x ) ∨ ∀ z ¬ Q ( z , x )) . 4. Renaming: A ≡ ∀ z ∀ x ( ¬ Q ( x , z ) ∧ ¬ P ( x )) ∨ ∃ y ( P ( y ) ∨ ∀ w ¬ Q ( w , y )) . 5. Using the equivalences (c)-(f) to pull the quantifiers in front: A ≡ ∀ z ∀ x ∃ y ∀ w (( ¬ Q ( x , z ) ∧ ¬ P ( x )) ∨ P ( y ) ∨ ¬ Q ( w , y )) . 6. The resulting formula is in a prenex DNF. For a prenex CNF we have to distribute the ∨ over ∧ : A ≡ ∀ z ∀ x ∃ y ∀ w (( ¬ Q ( x , z ) ∨ P ( y ) ∨¬ Q ( w , y )) ∧ ( ¬ P ( x ) ∨ P ( y ) ∨¬ Q ( w , y ))). Goranko

  9. Skolemization I: Skolem constants Skolemization: procedure for systematic elimination of the existential quantifiers in a first-order formula in a prenex form, by introducing new constant and functional symbols, called Skolem constants and Skolem functions, in the formula. ◮ Simple case: the result of Skolemization of the formula ∃ x ∀ y ∀ zA is the formula ∀ y ∀ zA [ c / x ], where c is a new (Skolem) constant. ⊲⊲ For instance, the result of Skolemization of the formula ∃ x ∀ y ∀ z ( P ( x , y ) → Q ( x , z )) is ∀ y ∀ z ( P ( c , y ) → Q ( c , z )). ◮ More generally, the result of Skolemization of the formula ∃ x 1 · · · ∃ x k ∀ y 1 · · · ∀ y n A is ∀ y 1 · · · ∀ y n A [ c 1 / x 1 , . . . , c k / x k ], where c 1 , . . . , c k are new (Skolem) constants. Note that the resulting formula is not equivalent to the original one, but is equally satisfiable with it. Goranko

  10. Skolemization II: Skolem functions ◮ The result of Skolemization of ∀ y ∃ zP ( y , z ) is ∀ yP ( y , f ( y )), where f is a new unary function, called Skolem function. ◮ More generally, the result of Skolemization of ∀ y ∃ x 1 · · · ∃ x k ∀ y 1 · · · ∀ y n A is ∀ y ∀ y 1 · · · ∀ y n A [ f 1 ( y ) / x 1 , . . . , f k ( y ) / x k ], where f 1 , . . . , f k are new Skolem functions. ◮ The result of Skolemization of ∀ x ∃ y ∀ z ∃ uA ( x , y , z , u ) is ∀ x ∀ zA [ x , f ( x ) / y , z , g ( x , z ) / u ) , where f is a new unary Skolem function and g is a new binary Skolem function. Goranko

  11. Skolemization III: the general case ◮ In the general case of Skolemization, the existential quantifiers are eliminated one by one, from left to right, by introducing at every step a Skolem function depending on all existentially quantified variables to the left of the existential quantifier that is being eliminated: ∀ x 1 . . . ∀ x k ∃ yA ( x 1 , . . . , x k , y , . . . ) is transformed to ∀ x 1 . . . ∀ x k A ( x 1 , . . . , x k , y , . . . )[ f ( x 1 , . . . , x k ) / y ] where f is a new k -ary Skolem function. Thus, eventually, all existential quantifiers are eliminated. Again, the resulting formula after Skolemization is generally not equivalent to the original one, but is equally satisfiable with it. Goranko

  12. Clausal form of first-order formulae A literal is an atomic formula or a negation of an atomic formula. Examples: P ( x ), ¬ P ( f ( c , g ( y ))), ¬ Q ( f ( x , g ( c )) , g ( g ( g ( y )))). A clause is a set of literals. Example: { P ( x ) , ¬ P ( f ( c , g ( y ))) , ¬ Q ( f ( x , g ( c )) , g ( g ( g ( y )))) } . A clausal form is a set of clauses. Example: { { P ( x ) } , {¬ P ( f ( c )) , ¬ Q ( g ( x , x ) , y ) } , {¬ P ( f ( y )) , P ( f ( c )) , Q ( y , f ( x )) } } . Goranko

  13. The logical meaning of first-order clauses All variables in a clause are assumed to be universally quantified. Thus, a clause represents the universal closure of the disjunction of literals in it. Example: { P ( x ) , ¬ P ( f ( c , g ( y ))) , ¬ Q ( f ( x , g ( c )) , g ( g ( g ( y )))) } represents � � ∀ x ∀ y P ( x ) ∨ ¬ P ( f ( c , g ( y ))) ∨ ¬ Q ( f ( x , g ( c )) , g ( g ( g ( y )))) The universal quantifiers will hereafter be omitted. Goranko

  14. The logical meaning of sets of first-order clauses A set of clauses represents the conjunction of the (formulae represented by the) clauses contained in it. � � Example: the set { P ( x ) } , {¬ P ( f ( c )) , ¬ Q ( x , y ) } , {¬ P ( f ( y )) , Q ( y , f ( x )) } represents the formula � � � � ∀ xP ( x ) ∧ ∀ x ∀ y ¬ P ( f ( c )) ∨ ¬ Q ( x , y ) ∧ ∀ x ∀ y ¬ P ( f ( y )) ∨ Q ( y , f ( x )) . Hereafter we will assume that no two clauses in a clausal form share common variables, which can always be achieved by means of renaming. Thus, the clausal form above can be re-written as: � � { P ( x ) } , {¬ P ( f ( c )) , ¬ Q ( x 1 , y 1 ) } , {¬ P ( f ( y 2 )) , Q ( y 2 , f ( x 2 )) } representing the formula ∀ xP ( x ) ∧ ∀ x 1 ∀ y 1 � ¬ P ( f ( c )) ∨ ¬ Q ( x 1 , y 1 ) � ∧ ∀ x 2 ∀ y 2 � ¬ P ( f ( y 2 )) ∨ Q ( y 2 , f ( x 2 )) � . Because ∀ distributes over ∧ , after the renaming the clausal form also represent the universal closure of the conjunction of the disjunctions represented by the clauses contained in it: � �� � � � ∀ x ∀ x 1 ∀ y 1 ∀ x 2 ∀ y 2 P ( x ) ∧ ¬ P ( f ( c )) ∨ ¬ Q ( x 1 , y 1 ) ∧ ¬ P ( f ( y 2 )) ∨ Q ( y 2 , f ( x 2 )) . Goranko

Recommend


More recommend