First Order Logic Dr Rogelio Dvila Prez ProfesorInvestigador

  • Slides: 17
Download presentation
First Order Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de

First Order Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara rdav 90@gmail. com

Predicate Logic I. Syntax 1. Vocabulary (a) (b) (c) (d) (e) (f) (g) (h)

Predicate Logic I. Syntax 1. Vocabulary (a) (b) (c) (d) (e) (f) (g) (h) Logical constants: Logical connectors: , , = Logical quantifiers: , Punctuation symbols: ‘(’ , ‘)’ , ‘, ’ Predicate symbols: Rn, Pm, Qs, … Functional symbols: fn, gm, rs, … Constant symbols: a, b, c, … Individual variables: x, y, z 2. Terms (a) (b) (c) A constant symbol is a term. An individual variable is a term. If fn is an n-ary function symbol and, t 1, …, tn are terms then fn (t 1, …, tn ) is a term.

Predicate Logic 3. Well-formed formulas (wffs) (a) is called contradiction an is a wff.

Predicate Logic 3. Well-formed formulas (wffs) (a) is called contradiction an is a wff. (b) (c) (d) (e) If Rn is an n-ary predicate symbol, and t 1, …, tn are terms then Rn (t 1, …, tn ) is a wff. If and are wffs, then , , and are also wffs. If is a formula and x is a variable, then x. (x) and x. (x) are also wffs. Nothing else is a wff.

Predicate Logic II. Rules of Inference (a) All inference rules from the propositional logic

Predicate Logic II. Rules of Inference (a) All inference rules from the propositional logic hold in predicate logic. (b) Universal quantifier rules -Intro -Elim (Universal Instantiation) (a) x. (x) … (a) x. ( (x)) Just in the case (a) and (a) are not premises, and there are no occurrences of ‘a’ in the premises.

Predicate Logic (a) Existential quantifier rules -Intro (a) -Elim y. (y) (a) … y.

Predicate Logic (a) Existential quantifier rules -Intro (a) -Elim y. (y) (a) … y. (y) Just in case ‘a’ does not occur in ‘ ’.

Predicate Logic Def. A first order theory consist of an alphabet, a first order

Predicate Logic Def. A first order theory consist of an alphabet, a first order language, a set of axioms and a set of inference rules. Def. A first order language given by an alphabet consists of the set of all well formulas constructed from the symbols of the alphabet. Def. The scope of x (resp. x), in x. (resp. x. ) is . Def. A bound occurrence of a variable in a formula is an occurrence immediately following a quantifier or an occurrence within the scope of a quantifier, which has the same variable immediately after the quantifier. Any other occurrence of a variable is free. Def. A closed formula is a formula with no free occurrences of any variable.

Predicate Logic Def. If is a formula, then ( ) denotes de universal closure

Predicate Logic Def. If is a formula, then ( ) denotes de universal closure of , which is the closed formula obtained by adding a universal quantifier for every variable having a free occurrence in . Def. Similarly, ( ) denotes the existential closure of , which is obtained by adding an existential quantifier for every variable having a free occurrence in .

Predicate Logic n Two important identities (a) x. (x) x. (x) (b) x. (x)

Predicate Logic n Two important identities (a) x. (x) x. (x) (b) x. (x) x. (x)

Logical Identities (a) v (b) Contraposition Law: (c) Distributive Laws: (i) v ( )

Logical Identities (a) v (b) Contraposition Law: (c) Distributive Laws: (i) v ( ) ( v ) (ii) ( v ) ( ) v ( ) (e) De. Morgan’s Laws: (i) ( v ) (ii) ( ) v x. (x) (g) x. (x) x. (x) (f) x. (x)

Predicate Logic n Translate English into Predicate Logic 1 (a) Monica likes some of

Predicate Logic n Translate English into Predicate Logic 1 (a) Monica likes some of her students. (b) Monica likes all her students. (c) All men are created equal. (d) Roses are red; violets are blue. (e) Some freshmen are intelligent. (f) All freshmen are intelligent. (g) No freshmen are intelligent. (h) One of the coats in the closet belongs to Sarah. (i) Some Juniors date only Seniors. (j) Not all birds can fly. Notes 1 All sentences were taken from Dra. Monica Noguera’s notes on CS 4320.

Predicate Logic n Translate English into Predicate Logic 1 (a) Every elephant has a

Predicate Logic n Translate English into Predicate Logic 1 (a) Every elephant has a trunk. (b) Adams is not married to anyone. (c) No freshmen are not serious. (d) Someone profited from the great depression. (e) All fish except sharks are kind to children. (f) Anyone with two or more spouses is a bigamist. (g) John married Mary and she got pregnant. (h) If all sophomores like Greek, then some freshmen do. (i) Everyone loves somebody and no one loves everybody, or somebody loves everybody and someone loves nobody. Notes 1 All sentences were taken from Dra. Monica Noguera’s notes on CS 4320.

Predicate Logic Semantics Definition. An interpretation of a term consists in a non empty

Predicate Logic Semantics Definition. An interpretation of a term consists in a non empty domain E, and an assignment function F: (i) (iii) To each constant symbol, it is assigned an individual from the domain. To each n-ary function symbol, it is assigned a mapping from E n E. To each n-ary predicate symbol, it is assigned a subset from E n.

Predicate Logic Semantics Definition. An interpretation of a wff consists of an mapping I:

Predicate Logic Semantics Definition. An interpretation of a wff consists of an mapping I: wffs {0, 1} as follows: (i) (iii) (iv) (vi) (vii) I(Pi(t 1, t 2, …, tn)) = 1 iff <F(t 1), F(t 2), …, F( tn) > F( Pi), 0 otherwise. I( ) = min(I( ), I( )) I( ) = max(I( ), I( )) I( ) = 0 if I( )=1 and I( )=0, 1 otherwise I( ) = 1 -I( ) I( x. (x)) = 1 if for all a E, I( (a))=1 I( x. (x)) = 1 if there is an F(a) E such that I( (a))=1.

Predicate Logic Definition. An interpretation of a set of well-formed formulas , is called

Predicate Logic Definition. An interpretation of a set of well-formed formulas , is called a MODEL of , if and only if, every wff in is true under that interpretation. Definition. A wff is called a logical consequence of a set of wffs , if and only if, is true in al models of ( |= ). Definition. A wff is satisfiable if it has a model, otherwise it is unsatisfiable.

Predicate Logic Example Lets define a simple language: Basic expressions: (i) Constant symbols: m,

Predicate Logic Example Lets define a simple language: Basic expressions: (i) Constant symbols: m, j, d and n. (ii) Predicate symbols: M 1, B 1, K 2, L 2. Sentences: M(d), B(j), K(j, n) and L(n, m) Evaluate the truth of the previous sentences according to the interpretations shown bellow.

Predicate Logic a). M 1=<A 1, F 1> A 1 = {x | x

Predicate Logic a). M 1=<A 1, F 1> A 1 = {x | x is a country in America} F 1(m) =peru, F 1(j)=chile, F 1(d)= honduras, F 1(n)= argentina F 1(M)={colombia, belice, argentina, canada, nicaragua} F 1(B)={x A 1| x borders the pacific ocean} F 1(K)={<x, y>| <x, y> A 1 x. A 1 , x borders y} F 1(L)={<x, y>| <x, y> A 1 x. A 1 , x is bigger than y} b). M 2=<A 2, F 2> A 2 = {x | x is an integer} F 2 (m) =0, F 1(j)=2, F 1(d)= 9, F 1(n)= -1 F 2 (M)={x A 2| x is odd} F 2 (B)={x A| x is a perfect square} F 2 (K)={<x, y>| <x, y> A 2 x. A 2 , and x > y} F 2 (L)={<x, y>|< x, y> A 2 x A 2 , x = y 2}

Predicate Logic Examples of arguments (a) (b) (c) (d) The mother will die unless

Predicate Logic Examples of arguments (a) (b) (c) (d) The mother will die unless the doctor kills the child. If the doctor kills the child, the doctor will be taking life. If the mother dies, the doctor will be taking life. Therefore, the doctor will be taking life. If the soil is suitable for carrots, then it is deep, sandy and free of stones. The soil is not suitable for linseed if it is sandy or a heavy clay. Therefore the soil is not suitable for both carrots and linseed. Bank-notes all carry a metal strip. Anything with a metal strip can be detected by X-rays. Therefore, bank-notes can be detected by X-rays. All the birds are either chiff-chaffs or willow warblers. The birds are singing near the ground. Chiff-chaffs don’t sing near the ground. Therefore the birds are all willow-warblers.