1 of 43

Sentence Meaning

LIN 141: Semantics

Masoud Jasbi

2 of 43

Watching lectures without doing the readings

Watching lectures having done the readings

3 of 43

Plan

Introduce Propositional Logic

Syntax Propositional Logic

BNF Definition

CFG Definition

Semantics of Propositional Logic

Natural Language vs. Propositional Logic

4 of 43

Defining a Language

Language (informal definition): a system associating symbols with meanings.

Lexicon: the set of symbols.

Syntax: the lexicon and the system that combines them.

Semantics: the meanings associated with the syntax.

Language (formal definition): a syntax mapped onto a semantics.

L= <Syn L, Sem L>

How realistic is this definition for human language?

5 of 43

Propositional Logic

6 of 43

A Short History

Propositional Logic is one of the oldest and most basic logical systems.

Started with Stoic philosophers like Chrysippus of Soli.

Modern version by the British mathematician George Boole.

The atoms (smallest meaningful units) are propositions.

George Boole

Mathematician

1815-1864

Chrysippus

280–207 BC

7 of 43

p = ⟦The cat is on the dog.⟧

8 of 43

Propositions

Informal Definition: the meaning of sentences.

The dog is on the cat.”

Sometimes we loosely talk about entailment or contradiction between sentences.

What we really mean: entailment or contradiction between the propositions they denote.

Sentence is a syntactic notion.

Proposition, entailment, and contradiction are semantic.

9 of 43

Syntax of Propositional Logic (BNF Definition)

Definition (Syntax of Lprop): Let ℙ be a set of propositional letters like p, q, r, …

φ ⩴ ℙ | ¬ φ | (φ ⋀ φ) | (φ ⋁ φ) | (φ → φ) | (φ ↔ φ)

John Backus

Peter Naur

p

q

r

¬p

¬q

¬r

p⋀q

p⋀r

q⋀r

q⋀p

r⋀p

r⋀q

p⋁q

p⋁r

q⋁r

q⋁p

r⋁p

r⋁q

p→q

p→r

q→r

q→p

r→p

r→q

p↔q

p↔r

q↔r

q↔p

r↔p

r↔q

¬(¬p)

¬(¬q)

¬(¬r)

¬(p⋀q)

¬(p⋀r)

¬(q⋀r)

¬(q⋀p)

¬(r⋀p)

¬(r⋀q)

p⋁(p⋀q)

p⋁(p⋀r)

p⋁(q⋀r)

p⋁(q⋀p)

p⋁(r⋀p)

p⋁(r⋀q)

10 of 43

Exercise: watch your form!

Which one is a well-formed formula of Lp?

  1. (p ¬ q)
  2. (((p ⋀ q) ¬ r) → (p ⋁ q))
  3. ((((p ↔ p) ⋀ p) ⋀ ¬ p) → ((p → ¬ p) → p))
  4. ((p ⋀ q) | (r ⋁ s))
  5. ((p → (q → r)) → ((p → q) → (p → r)))
  6. (φ ⋁ φ)

Definition (Syntax of Lprop): Let ℙ be a set of propositional letters like p, q, r, …

φ ⩴ | ¬ φ | (φ ⋀ φ) | (φ ⋁ φ) | (φ → φ) | (φ ↔ φ)

11 of 43

Scope

Let Lprop be the language of propositional logic.

Let ○ ∈ {¬, ⋀, ⋁, →, ↔} be a connective of Lp.

Let W be a well-formed formula of Lp.

The scope of an occurrence of ○ in W is the smallest well-formed part of W containing this occurrence of ○.

Example: (¬(p ⋀ q) → r)

12 of 43

Exercise: scope investigation

Use parentheses to determine possible scopes for each connective.

  1. ¬ p ⋀ q
  2. p ⋀ q ⋀ r
  3. p ⋀ q ⋁ r
  4. p ⋁ ¬ q → r ⋀ s

13 of 43

Syntax of Propositional Logic (CFG Definition)

S: starting symbol, N: nonterminal symbols, T: terminal symbols, R: rules

Context Free Grammar G = <S, N, T, R>

LProp= < φ, {φ}, {p,q,r, …, ¬,⋀, ⋁, →, ↔}, R >

R: φ ⇒ ¬ φ

φ ⇒ φ ⋀ φ

φ ⇒ φ ⋁ φ

φ ⇒ φ → φ

φ ⇒ φ ↔ φ

φ ⇒ p, q, r, s, t

Noam Chomsky

Linguist

CFG Machine:

alphabet +

connectives +

rules

p, q, r, p⋀q, p⋁q, p→q, p↔q, p⋀r, … , (p→q)⋁r, ...

14 of 43

Example

Alphabet: p,q,r,s,t, …., ¬,⋀, ⋁, →, ↔

Symbols of the Grammar: φ, ⇒

Rules of our grammar:

  1. φ ⇒ ¬ φ
  2. φ ⇒ (φ ⋀ φ)
  3. φ ⇒ (φ ⋁ φ)
  4. φ ⇒ (φ → φ)
  5. φ ⇒ (φ ↔ φ)
  6. φ ⇒ p, q, r, s, t, ...

φ

φ

φ

φ

φ

φ

¬

φ

¬

φ

¬

φ

φ

p

q

p

q

(¬(p ⋀ q) ↔ (¬p ⋁ ¬q))

15 of 43

Exercise

Which ones are valid sentences of propositional logic?

  1. p
  2. (p⋁q)
  3. (¬⋁r)
  4. → s
  5. ¬ ¬ ¬ ¬ ¬ ¬ ¬ p
  6. ((((p⋁q)⋀q)⋁p)→p)
  7. (pr→ s)

Alphabet: p,q,r,s,t, …., ¬,⋀, ⋁, →, ↔

Symbols of the Grammar: φ, ⇒

Rules of our grammar:

  • φ ⇒ ¬ φ
  • φ ⇒ (φ ⋀ φ)
  • φ ⇒ (φ ⋁ φ)
  • φ ⇒ (φ → φ)
  • φ ⇒ (φ ↔ φ)
  • φ ⇒ p, q, r, s, t, ...

16 of 43

Semantics for Lprop

Now we need to assignment meaning to all the formulas of Lprop.

φ ⩴ | ¬ φ | (φ ⋀ φ) | (φ ⋁ φ) | (φ → φ) | (φ ↔ φ)

We can start with the atomic propositions in like p, q, r, s ...

And then assign meaning to molecular propositions that involve connectives such as (p ⋀ q), (p ⋁ q) → ¬ r, …

17 of 43

Semantics for Lprop

Definition (Semantics of propositional logic): An interpretation function I is a function from atomic propositional letters to truth values 0 (F) and 1 (T).

I1(p) = 1, I1(q) = 1, ...

I2(p) = 1, I2(q) = 0, ...

I3(p) = 0, I3(q) = 1, ...

I4(p) = 0, I4(q) = 0, ...

18 of 43

Semantics of Propositional Logic

In propositional logic, the meaning of basic propositions (p,q,r, ...) are either true (1) or false (0).

The meaning of complex propositions are computed from the value of basic propositions according to the following truth tables.

19 of 43

Interpreting the Symbols

p = 1, q = 0

φ

φ

φ

φ

φ

φ

¬

φ

¬

φ

¬

φ

φ

p

q

p

q

(¬(p ⋀ q) ↔ (¬p ⋁ ¬q))

=1

=0

=1

=0

=0

=0

=1

=1

=1

=1

What if p=1, q=1?

Or p= 0, q=0?

Or p=0, q=1?

20 of 43

Exercise: moment of truth!

Compute the truth values of the following complex formulas using syntactic trees. Take the interpretation I5 with I5(p) = I5(q)=1, I5(r)=0.

  1. ⟦(¬ p ⋁ q)⟧I5 =
  2. ⟦((¬ p ⋁ q) → r)⟧I5 =
  3. ⟦(¬(p ⋁ q) → r)⟧I5 =

21 of 43

Truth Table

(p ⋀ q)(¬ p ¬ q) )

p

q

1

1

0

1

1

0

0

0

¬q

0

0

1

1

(p⋀q)

1

0

0

0

(¬ p ⋁ ¬ q)

0

1

1

1

¬ (p⋀q)

0

1

1

1

(¬ (p ⋀ q) ↔ (¬ p ⋁ ¬ q) )

1

1

1

1

¬p

0

1

0

1

22 of 43

Exercise: Table of Truths!

Provide truth tables for the following:

  • ⟦¬ (p ⋁ q)⟧
  • ⟦¬ (p ⋀ ¬ p)⟧
  • ⟦(¬p ⋀ ¬q)⟧
  • ⟦(¬ (p ⋁ q) ↔ (¬p ⋀ ¬q))⟧

23 of 43

Tautologies

A formula that gets the value 1 in every valuation is called a tautology.

The notation for tautologies is 𝜑.

Some Famous Tautologies:

  1. (φ ⋁ ¬φ) The Law of Excluded Middle
  2. ¬(φ ⋀ ¬φ) The Law of Non-contradiction
  3. ¬¬ φ ↔ φ Double Negation
  4. ¬(φ ⋁ ψ) ↔ (¬φ ⋀ ¬ψ) De Morgan’s Law
  5. ¬(φ ⋀ ψ) ↔ (¬φ ⋁ ¬ψ) De Morgan’s Law
  6. (φ ⋀ (ψ ⋁ χ)) ↔ ((φ ⋀ ψ) ⋁ (ψ ⋀ χ)) Distribution Law
  7. (φ ⋁ (ψ ⋀ χ)) ↔ ((φ ⋁ ψ) ⋀ (ψ ⋁ χ)) Distribution Law

24 of 43

Other binary connectives

Lprop used the following connectives: {¬,⋀, ⋁, →, ↔}

There are 16 possible binary connectives.

The choice of connective can lead up to different formal languages.

25 of 43

Inclusive vs. Exclusive Disjunction

Inclusive and exclusive disjunction have had an old competition in who is more primary!

Stoics thought exclusive disjunction is primary!

20th century logic considered inclusive disjunction to be more primary.

26 of 43

Natural Language &

Propositional Logic

27 of 43

From Language to Truth

Language

Syntax

Semantics

Abe was happy, Abe likes cheese, Abe or Bob like cheese, Abe likes Bob, Bob and Abe left, ...

TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ...

Grammar

Truth

Interpretation

28 of 43

From Lprop to Truth

Propositional Language

Syntax

Semantics

p, q, r, …

¬p, ¬q,¬r, ... (p⋀q), (p⋀r), (q⋀r), … (p⋁q), (p⋁r), (q⋁r), … (p→q), (p→r), (q→r), … (p⋀q)⋀(q→r)

TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ...

Grammar

Truth

Interpretation

29 of 43

Using Propositional Logic

Our goal was to build a model that does what language does.

We built one: propositional logic.

How do we model language with it? How good is this model?

The first step is to see what parts of language fits our model.

So we are going to represent language with propositional logic.

Another way to say it: we are translating language into propositional logic.

Like any translation/representation, there is some information loss.

30 of 43

The Syntax of Lprop & Language

31 of 43

Translating English to Propositional Logic

Human Language

Technical Name

Propositional Logic

Bob arrived, Abe didn’t win, Abe likes Bob and Joe, ...

Proposition

p, q, r, s, t, ...

not, n’t, no, ...

Negation

and

Conjunction

or

Disjunction

if (... then)

implication

if and only if

equivalence

32 of 43

Examples

Human Language

Technical Name

Propositional Logic

sentences

Proposition

p, q, r, s, t, ...

not, n’t, no, ...

Negation

and

Conjunction

or

Disjunction

if … then

implication

if and only if

equivalence

Abe was happy.

p

Abe likes cheese.

q

Abe was not happy.

¬p

Abe likes cheese and Abe was happy.

p⋀q

Abe likes cheese or Abe was happy.

p⋁q

If Abe was happy then Abe likes cheese.

p→q

Abe was happy or Abe was not happy.

p⋁¬p

If Abe does not like cheese then Abe was not happy.

¬q→¬p

If Abe likes cheese and Abe was happy then Bob was happy too.

(p⋀q)→r

If Abe was not happy and Abe does not like cheese, then Bob was not happy or Bob does not like cheese.

(¬p⋀¬q)

(¬r⋁¬s)

33 of 43

Exercise: Translate to Propositional Logic

If I go home late, my mom is going to kill me.

sentences

p, q, ...

not, n’t, no, ...

and

or

if … then

if and only if

If I don’t call home and go home late, my mom is going to kill me.

He has an Ace if he does not have a Knight or a Spade.

If it rains and you don’t have a car, then you can carry my umbrella.

He entered the store, did not buy a book or a pen, and if he talked to anyone, it was not me or anyone around me.

The ball is either in my room, or your room, or in the kitchen and since it is not in my room or the kitchen then it is in your room.

p→q

(r⋀¬p)→q

¬(k⋁s)→ a

(s⋀¬c)→ u

((e⋀¬(b⋁n))⋀(y→¬(x⋁o)))

((t⋁w)⋁h)⋀¬(t⋁h)→ w

34 of 43

A conversation in English and Lprop

Abe: ((p⋁q)⋁r)

Bob: ¬p

Abe: ¬q

Bob: r

Abe: It’s either in your room, my room, or in the kitchen.

Bob: It’s not in my room.

Abe: It’s not in my room either.

Bob: So it is in the kitchen!

Notice that we have still not really dealt with meaning.

We have only replaced words with logical symbols.

35 of 43

The Semantics of Lprop and Language

36 of 43

Language

Syntax

Semantics

There is a cat, there is a dog, there isn’t a cat, there isn’t a dog, there is a cat or a dog, there is a cat and a dog, ...

TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ...

Grammar

Truth

Interpretation

37 of 43

Propositional Language

Syntax

Semantics

p, q, …, ¬p, ¬q, ... (p⋀q), … (p⋁q), … (p→q), …, (p⋀q)⋀(q→r), ...

TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, ...

Grammar

Truth

Interpretation

38 of 43

Meaning in English and Propositional Logic

We have intuitions about truth of sentences in English.

In propositional logic, we defined meaning this way:

The meaning of basic propositions (p,q, ...) are either true (1) or false (0).

The meaning of complex propositions are computed from the following truth tables:

Do our English intuitions match the predictions of propositional logic?

39 of 43

Sentences and Connectives of English

There is a cat

There is a dog

There isn’t a cat

There isn’t a dog

There is a cat and a dog.

There is a cat or a dog.

If there is a cat then there is a dog.

TRUE

FALSE

FALSE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE?

TRUE

FALSE

TRUE

TRUE

TRUE?

TRUE?

FALSE

40 of 43

Propositions and Connectives in LP

p (cat)

q (dog)

¬p

¬q

p⋀q

p⋁q

p→q

TRUE

FALSE

FALSE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

TRUE

FALSE

FALSE

FALSE

TRUE

TRUE

FALSE

TRUE

TRUE

TRUE

TRUE

FALSE

41 of 43

Experimental Results

Response Proportion

42 of 43

Experimental Results (3-5 year-olds)

Response Proportion

43 of 43

Compositionality

The way we compute meaning in propositional logic allows us to model compositionality.

The meaning of complex formulas (sentences) are computed using the meaning of their parts and the way the were put together.