Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level...

56
Semantics and Inference Part II Johan Bos

Transcript of Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level...

Page 1: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Semantics and Inference

Part II

Johan Bos

Page 2: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Summary of last lecture

• Inferences on the sentence level– Entailment– Paraphrase– Contradiction

• Using logic to understand semantics– Introduction to propositional logic– Syntax– Semantics

Page 3: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Propositions

• What is a proposition? – Something that is expressed by a

declarative sentence making a statement– Something that has a truth-value

• Propositions can be true or false– There are only two possible truth-values– True, T or 1– False, F or 0

Page 4: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Ingredients of propositional logic

• Propositional variables– Usually: p, q, r, …

• Connectives– The symbols: , ,, , – Often called logical constants

• Punctuation symbols– The round brackets ( )

Page 5: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Syntax of propositional logic

• All propositional variables are propositional formulas

• If is a propositional formula, then so is

• If and are propositional formulas, then so are (), (), () and ()

• Nothing else is a propositional formula

Page 6: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Negation

• Symbol: • Pronounced as: “not” is called the negation of

• Truth-table:

True False

False True

Page 7: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Conjunction

• Symbol: • Pronounced as: “and”

• () is called the conjunction of the conjuncts and

• Truth table: ()

True True True

True False False

False True False

False False False

Page 8: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Disjunction

• Symbol: • Pronounced as: “or”

• () is called the disjunction of the disjuncts and

• Truth table:

()

True True True

True False True

False True True

False False False

Page 9: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

(Material) Implication

• Symbol: • Pronounced as: “implies” or “arrow”

• Truth table: ()

True True True

True False False

False True True

False False True

Page 10: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Equivalence (biconditional)

• Symbol:

• Pronounced as: “if and only if”

• Truth table: ()

True True True

True False False

False True False

False False True

Page 11: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Summary

()

True True True

True False False

False True False

False False True

()

True True True

True False False

False True True

False False True

()

True True True

True False True

False True True

False False False

()

True True True

True False False

False True False

False False False

True False

False True

Page 12: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

This lecture

• We will look at the role of tautologies in propositional logic

• Explain the method of truth tables to detect tautologies

• Apply this formal method to textual entailment

• Look further at the notion of truth

Page 13: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Tautologies

• A formula that is true in all situations is called a tautology or a semantic theorem

• Examples of tautologies: (pp)(qq)(pp)(p(qp))(p(qp))((pq)((pq)(q p))

Page 14: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Checking for tautologies

• How can we systematically check whether some formula is a tautology?

• This is the business of theorem proving– This is what mathematicians do, and– therefore is not our main concern here

• There are many methods– Using semantic tableaux (intuitive)– Using resolution (advanced)– Using truth-tables (nice for simple cases)

Page 15: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

1) Make a column for all propositional variables with possible truth-values

p

True

False

Page 16: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

2) Add columns for all sub-formulas

p p

True

False

Page 17: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

3) Put the formula itself in the last column

p p (pp)

True

False

Page 18: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

4) Fill in the truth values for the columns using the tables of the connectives

p p (pp)

True ?

False

Page 19: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

4) Fill in the truth values for the columns using the tables of the connectives

p p (pp)

True False

False ?

Page 20: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

4) Fill in the truth values for the columns using the tables of the connectives

p p (pp)

True False ?

False True

Page 21: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

4) Fill in the truth values for the columns using the tables of the connectives

p p (pp)

True False True

False True ?

Page 22: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

4) Fill in the truth values for the columns using the tables of the connectives

p p (pp)

True False True

False True True

Page 23: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Using a truth-table

Example: (pp)

5) Check the values in the last column

p p (pp)

True False True

False True True

All true in this column, hence tautology

Page 24: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Another example

Example: (p q)

1) Make a column for all propositional variables with possible truth-values

p q

True True

True False

False True

False False

Page 25: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Another example

Example: (p q)

2) Add columns for sub-formulas

p q

True True

True False

False True

False False

Page 26: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Another example

Example: (p q)

3) Add formula itself in last column

p q (p q)

True True

True False

False True

False False

Page 27: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Another example

Example: (p q)

4) Fill in the truth values

p q (p q)

True True True

True False False

False True True

False False True

Page 28: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Another example

Example: (p q)

5) Check values in last column

p q (p q)

True True True

True False False

False True True

False False True

Not all true in this column, hence no tautology

Page 29: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Which of the following are tautologies?

1) (p(pq))

2) (p(qr))

3) ((pq)p)

4) ((pq)(pq))

Page 30: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Tautologies and inference

• We are now ready to formalise the notions of– Entailment– Paraphrase– Contradiction

• Some notational convention– If S is a sentence, then we will write S'

meaning the logical translation of S.

Page 31: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Entailment

• Let S be a sentence and S' the logical translation of S. Then:

If (S1'S2') is a tautology, then S1 entails S2

Page 32: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Paraphrase

• Let S be a sentence and S' the logical translation of S. Then:

– Note: If S1 entails S2, and S2 entails S1, then S1 and S2 are paraphrases

If (S1'S2') is a tautology, then S1 and S2 are paraphrases

Page 33: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Contradiction

• Let S be a sentence and S' the logical translation of S. Then:

– Note: If a set of a sentences is not contradictory, they are called consistent

If (S1' S2') is a tautology, then S1 and S2 are contradictory or

inconsistent

Page 34: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Entailment, example 1

• Translate into propositional logic and check if entailment holds:

Diabolik found the treasure.

Eva will be happy if Diabolik found the treasure.

-----------------------------------------------------

Eva will be happy.

Page 35: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Entailment, example 2

• Translate into propositional logic and check if entailment holds:

Diabolik found the treasure.

Eva will be disappointed if Diabolik didn’t find the treasure.

-----------------------------------------------------

Eva won’t be disappointed.

Page 36: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

More about truth

• This is what logicians claim– In any situation, a declarative sentence is

true or false– In other words: it has one truth-value

• But does this make sense?– Life seems to be full of half-truths, grey

areas, and borderline cases– Logic divides the world into two parts: the

True and the False

Page 37: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Is logic an illusion?

• Maybe there are grades of truth?

• Can something be more true than something else?

• We will explore this question by looking at scaling and non-scaling adjectives– Scaling: small, big, fat, happy– Non-scaling: straight, silent, perfect

Page 38: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Scaling adjective: small

• If you pick a really small doll, it is still possible to pick an even smaller doll

• There can be two small dolls, one smaller than the other

Page 39: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Non-scaling adjective: straight

• Line (a) is straighter then line (b)

• This means line (b) is not really straight

• Line (a) could be straight, but not necessarily so

(a)

(b)

Page 40: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Is “true” a scalar adjective?

• It is not: if your statement is “truer” than mine, then mine is not wholly true

• “more true” can only mean “nearer the truth”– There are no degrees of truth– Truth is absolute

Page 41: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Borderline cases

• There is no precise cut-off point between small and not small

• Both scaling and non-scaling adjectives can have borderline cases

Page 42: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

What about “truth”?

• Although “truth” doesn’t have degrees, it does have borderline cases

• Look at the dolls and ask whether it is true this doll is small.

Page 43: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

What about “truth”?

• Although “truth” doesn’t have degrees, it does have borderline cases

• Look at the dolls and ask whether it is true this doll is small.

Page 44: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

What about “truth”?

• Although “truth” doesn’t have degrees, it does have borderline cases

• Look at the dolls and ask whether it is true this doll is small.

Page 45: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

The truth about “truth”

• Logicians are forced to admit that:

where borderline cases may arise, logic is not an exact science

• Logicians therefore stick to matter-of-fact notions, and leave the vague matters to philosophers

Page 46: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Misleading statements

• Some common English words like and, some and all can give rise to misleading statements

• Often the choice is to go for a weak or strong reading

• Logicians normally opt for a weak reading, but there are good arguments to opt for strong readings too

Page 47: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Misleading statement 1

• A witness in a case:

The poiliceman hit Mr Unlucky three times with the stick, and Mr Unlucky fell to the floor

• What the witness actually saw was that Mr Unlucky fell to the floor just before the policeman came into the room, and the policeman hit him three times with the stick before he could get up

Page 48: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Misleading statement 2

• After a dinner party, Diabolik admits to Eva:

I did kiss some of the girls…

• In fact, Diabolik kissed all nineteen girls that were are the party.

Page 49: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Misleading statement 3

• Groucho boasts to Dylan Dog:

All the girls at the party kissed me!

• In fact, there were no girls at this particular party

Page 50: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Misleading statements

• All of these three statements are misleading

• But are they true or false?

• There are two views here:– All of these statements were false

(the strong readings of the sentences)– The statements expressed the truth but

not the whole truth (weak readings)

Page 51: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Strong readings

• and implies and then in narratives

• some implies not all

• all implies at least one

Page 52: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Weak readings

• Omitting to mention something which any honest person would have mentioned, but not by saying something untrue

• Imagine Diabolik decided to be completely honest to Eva:

I did kiss some of the girls, in fact I kissed all nineteen of them

• Does Diabolik contradicts himself or not?

Page 53: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Entailment or not?

• Milan is more expensive city than Rome.• Rome is an expensive city.

• Pisa is a small town with a leaning tower.• Pisa is a town with a leaning tower.

• Bologna is the cultural capital of Italy.• Bologna is the capital of Italy.

• Milan is a smaller city than Rome.• Milan is a small city.

Page 54: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Entailment or not?

• All churches in Rome are beautiful.• All old churches in Rome are beautiful.

• Some churches in Rome are beautiful.• Some old churches in Rome are beautiful.

• Turin has the highest tower of Italy.• Turin has the highest leaning tower of Italy.

• Pisa has the highest leaning tower of Italy.• Pisa has the highest tower of Italy.

Page 55: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Entailment Test Suites

• Fracas Deliverable D16• Pascal Recognising Textual Entailment

– RTE-1– RTE-2– RTE-3

• Microsoft Research Paraphrase Corpus

• See:http://homepages.inf.ed.ac.uk/jbos/rte/

Page 56: Semantics and Inference Part II Johan Bos. Summary of last lecture Inferences on the sentence level –Entailment –Paraphrase –Contradiction Using logic.

Further reading

• Cann (1993): Formal Semantics; An introduction, Chapter 7

• Hodges (1977): Logic. An introduction to elementary logic.

• Hurford & Heasley (1983): Semantics. A coursebook, Unit 10

• Lyons (1977): Semantics, Volume 1, Chapter 6