lecture slides for mat 60556 part iii first order logic
play

Lecture Slides for MAT-60556 PART III: First order logic: Formulas, - PowerPoint PPT Presentation

Lecture Slides for MAT-60556 PART III: First order logic: Formulas, Models, Tableaux Henri Hansen September 20, 2013 1 Relations and predicates Theories with axioms and theorems in mathematics are defined on sets such as the set of


  1. Lecture Slides for MAT-60556 PART III: First order logic: Formulas, Models, Tableaux Henri Hansen September 20, 2013 1

  2. Relations and predicates • Theories with axioms and theorems in mathematics are defined on sets such as the set of integers Z • We need to be able to write and manipulate for- mulas that contain relations on the elements from arbitrary sets • R ⊆ D n is called an n -ary relation over the domain D . We also call relations predicates . • R can be represented by a boolean function P R : D n �→ { T, F } 2

  3. First Order Logic Symbols • Let P , A , and V be countable sets of predicate, con- stant , and variable symbols . Each predicate p n ∈ P is associated with arity . • “ ∀ ” is the universal quantifier, and “ ∃ ” is the exis- tential quantifier • Variables and constants are called terms . Terms are elements of some (possibly unknown) set • The arguments of a predicate are terms. 3

  4. FOL Syntax • An atomic formula is an n -ary predicate followed by a list of arguments. A formula is a tree defined recursively as follows: 1. A formula is a leaf that is labeled by an atomic formula 2. A formula is a node labeled with a logical oper- ator (as in propositional logic), and its children are formulas 3. A formula is labeled by ∀ x or ∃ x for some variable x , and it has a single child that is a formula 4

  5. Scope of variables • A formula such as ∀ xA is a quantified formula . x is the quantified variable, and its scope is the formula A . x is not required to actually appear in A • Let A be a formula. An occurrence of x in A is a free variable of A iff x is not within the scope of a quantified variable x . A variable that is not free, is bound • A formula with no free variables is closed and a formula with free variables is open 5

  6. Interpretation and Assignment • Let A be a formula where { p 1 , . . . , p m } are the pred- icates, and { a 1 , . . . , a k } are the constants that ap- pear. An interpretation for A , I A is a triple ( D, { R 1 , . . . , R m } , { d 1 , . . . , d k } ) where D is a non-empty set called domain , R i ⊆ D n i is a relation assigned to the predicate p i and d i ∈ D is the element assigned to the constant a i . • An assignment σ I A : V �→ D is a function that maps each free variable to an element of D 6

  7. Validity and satisfiability • The truth value of a closed formula depends only on the interpretation (not assignment) • Given a closed formula A in first-order logic 1. A is true in the intrepretation I iff ν I ( A ) = T , denoted I | = A 2. A is valid if it is true for all interpretations, de- noted | = A 3. A is satisfiable if there is some interpretation I such that I | = A 7

  8. Logical equivalence • Given two formulas A 1 and A 2 we write A 1 ≡ A 2 if they are true for the same interpretations • Given U = { A 1 , . . . , a n } of closed formulas, 1. A ≡ B iff | = A ↔ B 2. U | = A iff | = ( A 1 ∧ · · · ∧ A n ) → A 3. ∀ xA ( x ) ≡ ¬∃ x ¬ A ( x ) 4. ∃ xA ( x ) ≡ ¬∀ x ¬ A ( x ) 8

  9. Semantic Tableaux • let A be a quantified formula, either ∀ xA 1 ( x ) or ∃ xA 1 ( x ) and let a be a constant. An instantiation of A is the formula A 1 ( a ), where all the free occur- rences of x have been replaced by a • A literal is a closed atomic formula p ( a 1 , . . . , a k ), where all arguments are constants, or the negation of such a formula. • A semantic tableau is a tree T where each node is labeled by a pair ( U ( n ) , C ( n )) where U is a set of formulas and C is a set of constants that appear in the formulas of U ( n ) 9

  10. Semantic Tableaux (contd.) • A branch of a semantic tableau can be infinite, finite and marked open, or finite and marked closed • The root of the tableau for the formula φ is marked ( { φ } , { a 0 1 , . . . , a 0 k } ), where the constants are the constans appearing in φ • If U ( l ) contains a complementary pair of literals, then it should be marked closed, or × 10

  11. Rules for Tableaux • The same α - and β - rules as used with tableaux for propositional formulas applies for first order logic • In addition, we have γ and δ rules • γ - formula is either ∀ xA ( x ) or ¬∃ xA ( x ), and the result is A ( a ) or ¬ A ( a ) resp. where a is an arbitrary constant • δ - formula is either ∃ xA ( x ) or ¬∀ xA ( x ), and the result is A ( a ) or ¬ A ( a ) 11

  12. Semantic Tableau algorithm for the formula φ . • Start with {{ φ } , { a 0 , . . . , a n }} at the root. • Choose an unmarked leaf { U, C } and apply the first applicable rule from the following list and start over. 1. If the set U contains a complementary pair of literals, close the branch. 2. Choose a formula A ∈ U that is either an α − , β − or δ -formula; apply the rule 3. Apply the γ -rule. If the resulting formula is the same as before applying it, mark the branch open. 12

  13. Handling of formulas • If A is an α -formula, create a new node as the child of l , and label it with (( U ( l ) − { A } ) ∪ { α 1 , α 2 } , C ( l )) • If A is a β - formula, create two new nodes as chil- dren of l and label them with 1. (( U ( l ) − { A } ) ∪ { β 1 } , C ( l )) 2. (( U ( l ) − { A } ) ∪ { β 2 } , C ( l )) • If A is a δ - formula, create a new node as the child of l , and label it with (( U ( l ) −{ A } ) ∪{ δ ( a ′ ) } , C ( l ) ∪{ a ′ } ), where a ′ does not appear in U ( l ) 13

  14. Handling of formulas (contd.) • Given the set { γ 1 , . . . , γ m } ⊆ U , of the γ -formulas of U , create a new node as a child of l , and label it m ∪ ∪ with formulas ( U ∪ { γ i ( c ) } , C ) i =1 c ∈ C • In other words: a γ -formula γ i is added by γ i ( c ) for all the constants c in the formula. 14

  15. Soundness of Tableaux • Let φ be a formula of first order logic, and T be a tableau for φ . If T closes, then φ is unsatisfiable – Proof is by induction on the height of a node; α and β -rules are like in the propositional case. – γ -rules add A ( a ) to a child, when ∀ xA ( x ) ap- pears, and if A ( a ) is unsat, then ∀ xA ( x ) is unsat – δ -rules replace ∃ xA ( x ) with A ( a ) for a new a . Assume the former is satisfiable. Then it has a model. As it has a model, then there is some constant a for which A ( a ) is satisfiable, and thus A ( a ) has a model too. 15

  16. Hintikka sets • U is a Hintikka set if for all formulas A ∈ U ∈ U or A c / 1. If A is a literal, then either A / ∈ U 2. If A is an α -formula, then α 1 ∈ U and α 2 ∈ U 3. If A is a β -formula, then β 1 ∈ U or β 2 ∈ U 4. If A is a γ -formula, then γ ( c ) ∈ U for all constants in the formulas of U 5. If A is a δ -formula, then δ ( c ) ∈ U for some con- stant c 16

  17. Completeness: • Theorem: If U is a Hintikka set, then there is a model for U • Theorem: If A is a valid formula, the semantic tableau for ¬ A closes – If the tableaux for ¬ A does not close, this means that we can construct a Hintikka set from an open branch, which implies there is a model for ¬ A , and thus, A is not valid • In summary: Tableaux can establish the validity of A by finding whether ¬ A has a model, but the tableau itself does not directly yield a model 17

  18. Deductive systems • As with propositional logic, deductive systems can be used to prove formulas of first-order logic. They do so by taking axioms and rules of inference as before, but new rules and axioms are needed for quantifiers • We leave familiarization with deductive systems (Gentzen and Hilbert) as an exercise 18

  19. Normal forms in FOL • Consider the formula ∀ x ∀ y ∀ z ( p ( x, y ) ∧ p ( y, z )) → p ( x, z ), under the interpretation { Z , { < } , {}} • The formula states that the less-than- relation is transitive in the domain of the integers • Suppose we wish to express something like ∀ x ∀ y ∀ z ( x < y ) → x + z < y + z • The diffeerence is that in addition to the predicate “ < ”, it uses the function “+”. We first extend first-order logic with functions in order to discuss such statements 19

  20. FOL with functions • Let F be a (countable) set of function symbols , where each symbol has an arity denoted by a su- perscript. • A term is defined recursively as follows – A variable, constant, or 0-ary function is a term – if f n is an n -ary function symbol and { t 1 , . . . , t n } is a set of terms, then f ( t 1 , . . . , t n ) is a term • In the extended logic, an atomic formula is a n -ary predicate followed by a list of terms, i.e., p ( t 1 , . . . , t n ) 20

  21. FOL interpretation with functions • Let U be a set of formulas, and p 1 , . . . , p k the pred- icate symbols, f 1 , . . . , f l the function symbols and a 1 , . . . , a m the constant symbols of U . An interpre- tation for U is a 4-tuple 1 , . . . , F n l { D, { R 1 , . . . , R k } , { F n 1 l } , { d 1 , . . . , d m }} consisting of the domain D , relations R i on D as- sociated with each predicate symbol p i , functions F i on D associated with f i and elements d i of D associated with a i • The semantics of the interpretation are the same as for FOL without functions 21

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