Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring

  • Slides: 18
Download presentation
Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006 -Lecture 8 1

Introduction to Computational Linguistics Eleni Miltsakaki AUTH Spring 2006 -Lecture 8 1

What’s the plan for today? • Basic concepts of logic • Propositional logic (aka

What’s the plan for today? • Basic concepts of logic • Propositional logic (aka statement logic) • Predicate logic (aka first order logic) 2

Natural language and formal languages • Natural languages: acquired as first language in childhood

Natural language and formal languages • Natural languages: acquired as first language in childhood to serve any communicative goal we have • Formal languages: designed by people for a clear, particular purpose • One of the most important uses linguists make of formal languages is to represent meaning in natural languages. 3

Logic • Logical languages can be used as metalanguages to formalize reasoning from axioms

Logic • Logical languages can be used as metalanguages to formalize reasoning from axioms and theorems in a specific domain. • Here, we’ll develop the background for applications of logic and formal languages to natural languages 4

Language of logic • Syntax-semantics – Syntax: primitives, axioms, well-formedness, rules of inference or

Language of logic • Syntax-semantics – Syntax: primitives, axioms, well-formedness, rules of inference or rewrite rules, theorems – Semantics: relation of syntax to interpretation 5

Semantics • For our purposes: semantics is the study of the relations of formal

Semantics • For our purposes: semantics is the study of the relations of formal systems to their interpretations 6

About propositional and predicate logic • Each is a formal language with its own

About propositional and predicate logic • Each is a formal language with its own vocabulary, rules of syntax and semantics (or system of interpretation) • Both are much simpler than natural languages – Only declarative statement (no questions, imperatives) – Connectives: and, or, not, if…then, if and only if but no because, while, after, although etc – Determiners: some, all, no, every but not most, many, a few, several, one half etc • Logic is the study of reasoning (the product, not the process) with the objective of finding correct, or valid, instances and distinguishing them from those that are invalid. 7

Example All men are mortals Socrates is a man ____________________________ Therefore, Socrates is mortal

Example All men are mortals Socrates is a man ____________________________ Therefore, Socrates is mortal All cats are mammals All dogs are mammals ____________________ Therefore, all cats are dogs A systematic account of what underlies our intuitions about the validity of our inferences 8

Argument form Systematic replacements All rabbits are rodents Peter is a rabbit ____________________ Therefore,

Argument form Systematic replacements All rabbits are rodents Peter is a rabbit ____________________ Therefore, Peter is a rodent All X’s are Y’s a is an X ____________________ Therefore, a is a Y 9

Propositional logic • Vocabulary – Infinite vocabulary of atomic statements, p, q, r, s,

Propositional logic • Vocabulary – Infinite vocabulary of atomic statements, p, q, r, s, etc • Syntax – Any atomic statement itself is a sentence or wellformed formula (wff) – Any wff preceded by ~ is also a wff – Any two wffs can be made into another wff by conjunction, disjunction, conditional or biconditional 10

Propositional logic • Semantics – Truth values: 1 or 0 – Truth tables •

Propositional logic • Semantics – Truth values: 1 or 0 – Truth tables • • • Negation Conjunction Disjunction Conditional Bi-conditional 11

Laws of propositional logic • • • Idempotent laws Associative laws Commutative laws Distributive

Laws of propositional logic • • • Idempotent laws Associative laws Commutative laws Distributive laws Identity laws Complement laws De. Morgan’s laws Conditional laws Bi-conditional laws 12

Rules of inference • • Modus Ponens Modus Tollens Hypothetical syllogism Disjunctive syllogism Simplification

Rules of inference • • Modus Ponens Modus Tollens Hypothetical syllogism Disjunctive syllogism Simplification Conjunction Addition 13

Some simple exercises • Example: If John is at the party, then Mary is

Some simple exercises • Example: If John is at the party, then Mary is too. – Translation: (p q) – Key: p=John is at the party, q=Mary is at the party • Translate the following sentences in propositional logic 1. Either John is in that room or Mary is, or possibly they both are 2. The fire was set by an arsonist, or there was an accidental explosion in the boiler room 3. When it rains, it pours 4. Sam wants a dog but Alice prefers cats 14

Predicate logic • Vocabulary – Individual constants: j, m, . . . – Individual

Predicate logic • Vocabulary – Individual constants: j, m, . . . – Individual variables: x, y, z, … – Predicates: P, Q, R, … each with a fixed number of arguments called its arity – The five connectives of propositional logic (negation, and, or, if-then, if and only if) – Two quantifiers: universal and existential – Auxiliary symbols: parentheses and brackets 15

Syntax of predicate logic • See handout 16

Syntax of predicate logic • See handout 16

Semantics of predicate logic • Truth values: 1, 0 • Truth value is determined

Semantics of predicate logic • Truth values: 1, 0 • Truth value is determined by the semantic value of the components of a formula • Set D of individuals, discourse domain • Example – H(s) – s has as its semantic value some individual chosen from a set D of individuals presumed to be fixed in advance. Say D includes Socrates and Aristotle. The statement H(s) gets the truth value true by the fact that the individual corresponding to s is a member of the set corresponding to H. • A two place predicate has as its semantic value a set of ordered pairs of individuals from D and so on and so forth. 17

Some simple exercises • Translate the following English sentences into predicate logic: 1. 2.

Some simple exercises • Translate the following English sentences into predicate logic: 1. 2. 3. 4. 5. 6. 7. 8. Everything is black or white A dog is a quadruped Everybody loves somebody Someone is loved by everyone There is someone whom everyone loves No one loves himself unless it’s John If you love a woman, kiss her or lose her People who live in New York love it 18