Presentation is loading. Please wait.

Presentation is loading. Please wait.

Formal Semantics for Natural Language Dr. Rogelio Dávila Pérez Depto. De Tecnologías de la Información ITESM, campus Guadalajara

Similar presentations


Presentation on theme: "Formal Semantics for Natural Language Dr. Rogelio Dávila Pérez Depto. De Tecnologías de la Información ITESM, campus Guadalajara"— Presentation transcript:

1 Formal Semantics for Natural Language Dr. Rogelio Dávila Pérez Depto. De Tecnologías de la Información ITESM, campus Guadalajara rogelio.davila@itesm.mx

2 Predicate Logic I. Syntax 1. Vocabulary (a)Logical constants:  (b)Logical connectors: , , , , = (c)Logical quantifiers: ,  (d)Punctuation symbols: ‘(’, ‘)’, ‘,’ (e)Predicate symbols: R n, P m, Q s, … (f)Functional symbols: f n, g m, r s, … (g)Constant symbols: a, b, c, … (h)Individual variables: x, y, z

3 Predicate Logic 2. Terms (i)A constant symbol is a term. (ii)An individual variable is a term. (iii)If f n is an n-ary function symbol and, t 1, …, t n are terms then f n (t 1, …, t n ) is a term.

4 Predicate Logic 3. Well-formed formulas (wffs) (a) is called contradiction an is a wff. (b)If R n is an n-ary predicate symbol, and t 1, …, t n are terms then R n (t 1, …, t n ) is a wff. (c) If  and  are wffs, then , ,  and  are also wffs. (d)If  is a formula and x is a variable, then x.(x) and  x.(x) are also wffs. (e)Nothing else is a wff.

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

6 (a) Existential quantifier rules  -Intro  -Elim  -Intro  -Elim Rules of Inference  (a)  y.  (y)  (a) …   y.  (y)  Just in case ‘a’ does not occur in ‘  ’.

7 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 form 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. Important concepts

8 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 . Important concepts

9 Logical Identities (a)       v  (b) Contraposition Law:          (c) Distributive Laws: (i)  v (  )  ( v )  ( v ) (ii)   ( v )  (  ) v (  ) (e) DeMorgan’s Laws: (i)  ( v )       (ii)  (  )    v   (ii)  (  )    v   (f)  x. (x)  x.  (x) (g)  x. (x)  x.  (x)

10  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 CS4320. Some exercises

11  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. or somebody loves everybody and someone loves nobody.Notes 1 All sentences were taken from Dra. Monica Noguera’s notes on CS4320.

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

13 Definition. An interpretation of a wff  consists of an mapping I: wffs  {0,1} as follows: (i) I(P i (t 1, t 2,…,t n )) = 1 iff  F( P i ), 0 otherwise. (ii) I (   ) = min(I(  ),I(  )) (iii) I (   ) = max(I(),I()) (iv) I (  ) = 0 if I()=1 and I()=0, 1 otherwise (v) I ( ) = 1-I() (vi) I ( x.(x)) = 1 if for all a  E, I((a))=1 (vii) I(x.(x)) = 1 if there is an F(a)  E such that I((a))=1. Predicate Logic Semantics

14 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.

15 Predicate Logic Semantics 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.

16 Predicate Logic Semantics a). M 1 = a). M 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)={ |  A 1 xA 1, x borders y} F 1 (L)={ |  A 1 xA 1, x is bigger than y} b). M 2 = b). M 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)={ |  A 2 xA 2, and x > y} F 2 (L)={ |  A 2 x A 2, x = y 2 }

17 Examples of arguments (a) 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. (b) 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. (c) 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. (d) 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. Predicate Logic Examples

18 Examples of arguments (a) 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. (b) 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. (c) 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. (d) 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. Formal Semantics for Natural Language


Download ppt "Formal Semantics for Natural Language Dr. Rogelio Dávila Pérez Depto. De Tecnologías de la Información ITESM, campus Guadalajara"

Similar presentations


Ads by Google