Transcript
Page 1: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

INF3580 – Semantic Technologies – Spring 2012Lecture 5: Mathematical Foundations

Martin Giese

14th February 2012

Department ofInformatics

University ofOslo

Page 2: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Sommerjobb ved FFI

Sommerjobber ved Forsvarets Forskningsinstitutt

Pa Kjeller ved Lillestrøm

Omtrent 50 studenter ved FFI i 8-10 uker

Mange forskjellige fagfelt, bl.a. semantiske teknologier

angi ved søking!

Søknadsfrist: 1. mars

Mer info: http://www.ffi.no/no/Om-ffi/Karriere/Sider/Sommerjobb.aspx

INF3580 :: Spring 2012 Lecture 5 :: 14th February 2 / 41

Page 3: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Today’s Plan

1 Basic Set Algebra

2 Pairs and Relations

3 Propositional Logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 3 / 41

Page 4: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Outline

1 Basic Set Algebra

2 Pairs and Relations

3 Propositional Logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 4 / 41

Page 5: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 6: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 7: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 8: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 9: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 10: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 11: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Motivation

The great thing about Semantic Technologies is. . .

. . . Semantics!

“The study of meaning”

RDF has a precisely defined semantics (=meaning)

Mathematics is best at precise definitions

RDF has a mathematically defined semantics

INF3580 :: Spring 2012 Lecture 5 :: 14th February 5 / 41

Page 12: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets: Cantor’s Definition

From the inventor of Set Theory, Georg Cantor (1845–1918):

Unter einer “Menge” verstehen wir jede Zusammenfassung M von bestimmtenwohlunterschiedenen Objekten m unserer Anschauung oder unseres Denkens (welche die“Elemente” von M genannt werden) zu einem Ganzen.

Translated:

A “set” is any collection M of definite, distinguishable objects m of our intuition or intellect(called the “elements” of M) to be conceived as a whole.

There are some problems with this, but it’s good enough for us!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 6 / 41

Page 13: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets: Cantor’s Definition

From the inventor of Set Theory, Georg Cantor (1845–1918):

Unter einer “Menge” verstehen wir jede Zusammenfassung M von bestimmtenwohlunterschiedenen Objekten m unserer Anschauung oder unseres Denkens (welche die“Elemente” von M genannt werden) zu einem Ganzen.

Translated:

A “set” is any collection M of definite, distinguishable objects m of our intuition or intellect(called the “elements” of M) to be conceived as a whole.

There are some problems with this, but it’s good enough for us!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 6 / 41

Page 14: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets: Cantor’s Definition

From the inventor of Set Theory, Georg Cantor (1845–1918):

Unter einer “Menge” verstehen wir jede Zusammenfassung M von bestimmtenwohlunterschiedenen Objekten m unserer Anschauung oder unseres Denkens (welche die“Elemente” von M genannt werden) zu einem Ganzen.

Translated:

A “set” is any collection M of definite, distinguishable objects m of our intuition or intellect(called the “elements” of M) to be conceived as a whole.

There are some problems with this, but it’s good enough for us!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 6 / 41

Page 15: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets: Cantor’s Definition

From the inventor of Set Theory, Georg Cantor (1845–1918):

Unter einer “Menge” verstehen wir jede Zusammenfassung M von bestimmtenwohlunterschiedenen Objekten m unserer Anschauung oder unseres Denkens (welche die“Elemente” von M genannt werden) zu einem Ganzen.

Translated:

A “set” is any collection M of definite, distinguishable objects m of our intuition or intellect(called the “elements” of M) to be conceived as a whole.

There are some problems with this, but it’s good enough for us!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 6 / 41

Page 16: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets: Cantor’s Definition

From the inventor of Set Theory, Georg Cantor (1845–1918):

Unter einer “Menge” verstehen wir jede Zusammenfassung M von bestimmtenwohlunterschiedenen Objekten m unserer Anschauung oder unseres Denkens (welche die“Elemente” von M genannt werden) zu einem Ganzen.

Translated:

A “set” is any collection M of definite, distinguishable objects m of our intuition or intellect(called the “elements” of M) to be conceived as a whole.

There are some problems with this, but it’s good enough for us!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 6 / 41

Page 17: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 18: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 19: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in it

knowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 20: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 21: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 22: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 23: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 24: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in B

everything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 25: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets

A set is a mathematical object like a number, a function, etc.

Knowing a set is

knowing what is in itknowing what is not

There is no order between elements

Nothing can be in a set several times

Two sets A and B are equal if they contain the same elements

everything that is in A is also in Beverything that is in B is also in A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 7 / 41

Page 26: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Elements, Set Equality

Notation for finite sets:

{· · · }{‘a’, 1,4}

Contains ‘a’, 1, and 4, and nothing else.There is no order between elements

{1,4} = {4, 1}Nothing can be in a set several times

{1,4,4} = {1,4}The notation {· · · } allows to write things several times!⇒ different ways of writing the same thing!We use ∈ to say that something is element of a set:

∈1 ∈ {‘a’, 1,4}‘b’ 6∈ {‘a’, 1,4}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 8 / 41

Page 27: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Elements, Set Equality

Notation for finite sets:

{· · · }{‘a’, 1,4}Contains ‘a’, 1, and 4, and nothing else.

There is no order between elements

{1,4} = {4, 1}Nothing can be in a set several times

{1,4,4} = {1,4}The notation {· · · } allows to write things several times!⇒ different ways of writing the same thing!We use ∈ to say that something is element of a set:

∈1 ∈ {‘a’, 1,4}‘b’ 6∈ {‘a’, 1,4}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 8 / 41

Page 28: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Elements, Set Equality

Notation for finite sets:

{· · · }{‘a’, 1,4}Contains ‘a’, 1, and 4, and nothing else.There is no order between elements

{1,4} = {4, 1}

Nothing can be in a set several times

{1,4,4} = {1,4}The notation {· · · } allows to write things several times!⇒ different ways of writing the same thing!We use ∈ to say that something is element of a set:

∈1 ∈ {‘a’, 1,4}‘b’ 6∈ {‘a’, 1,4}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 8 / 41

Page 29: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Elements, Set Equality

Notation for finite sets:

{· · · }{‘a’, 1,4}Contains ‘a’, 1, and 4, and nothing else.There is no order between elements

{1,4} = {4, 1}Nothing can be in a set several times

{1,4,4} = {1,4}

The notation {· · · } allows to write things several times!⇒ different ways of writing the same thing!We use ∈ to say that something is element of a set:

∈1 ∈ {‘a’, 1,4}‘b’ 6∈ {‘a’, 1,4}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 8 / 41

Page 30: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Elements, Set Equality

Notation for finite sets:

{· · · }{‘a’, 1,4}Contains ‘a’, 1, and 4, and nothing else.There is no order between elements

{1,4} = {4, 1}Nothing can be in a set several times

{1,4,4} = {1,4}The notation {· · · } allows to write things several times!⇒ different ways of writing the same thing!

We use ∈ to say that something is element of a set:

∈1 ∈ {‘a’, 1,4}‘b’ 6∈ {‘a’, 1,4}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 8 / 41

Page 31: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Elements, Set Equality

Notation for finite sets:

{· · · }{‘a’, 1,4}Contains ‘a’, 1, and 4, and nothing else.There is no order between elements

{1,4} = {4, 1}Nothing can be in a set several times

{1,4,4} = {1,4}The notation {· · · } allows to write things several times!⇒ different ways of writing the same thing!We use ∈ to say that something is element of a set:

∈1 ∈ {‘a’, 1,4}‘b’ 6∈ {‘a’, 1,4}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 8 / 41

Page 32: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}

{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},

The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 33: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}

{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}

{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},

The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 34: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},

The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 35: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}

{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},

The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 36: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 37: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},

The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 38: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 39: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 40: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 41: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 42: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 43: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Examples

{3, 7, 12}: a set of numbers

3 ∈ {3, 7, 12}, 0 6∈ {3, 7, 12}{0}: a set with only one element

0 ∈ {0}, 1 6∈ {0}{‘a’, ‘b’, . . . , ‘z’}: a set of letters

‘y’ ∈ {‘a’, ‘b’, . . . , ‘z’}, ‘æ’ 6∈ {‘a’, ‘b’, . . . , ‘z’},The set P3580 of people in the lecture room right now

Martin ∈ P3580, Albert Einstein 6∈ P3580.

N = {1, 2, 3, . . .}: the set of all natural numbers

3580 ∈ N, π 6∈ N.

P = {2, 3, 5, 7, 11, 13, 17, . . .}: the set of all prime numbers

257 ∈ P, 91 6∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 9 / 41

Page 44: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Know Your Elements!

Sets with different elements are different:

{1, 2} 6= {2, 3}

What about{a, b} and {b, c}?

If a, b, c are variables, maybe

a = 1, b = 2, c = 1

Then{a, b} = {1, 2} = {2, 1} = {b, c}

{1, 2, 3} has 3 elements, what about {a, b, c}?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 10 / 41

Page 45: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Know Your Elements!

Sets with different elements are different:

{1, 2} 6= {2, 3}

What about{a, b} and {b, c}?

If a, b, c are variables, maybe

a = 1, b = 2, c = 1

Then{a, b} = {1, 2} = {2, 1} = {b, c}

{1, 2, 3} has 3 elements, what about {a, b, c}?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 10 / 41

Page 46: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Know Your Elements!

Sets with different elements are different:

{1, 2} 6= {2, 3}

What about{a, b} and {b, c}?

If a, b, c are variables, maybe

a = 1, b = 2, c = 1

Then{a, b} = {1, 2} = {2, 1} = {b, c}

{1, 2, 3} has 3 elements, what about {a, b, c}?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 10 / 41

Page 47: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Know Your Elements!

Sets with different elements are different:

{1, 2} 6= {2, 3}

What about{a, b} and {b, c}?

If a, b, c are variables, maybe

a = 1, b = 2, c = 1

Then{a, b} = {1, 2} = {2, 1} = {b, c}

{1, 2, 3} has 3 elements, what about {a, b, c}?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 10 / 41

Page 48: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Know Your Elements!

Sets with different elements are different:

{1, 2} 6= {2, 3}

What about{a, b} and {b, c}?

If a, b, c are variables, maybe

a = 1, b = 2, c = 1

Then{a, b} = {1, 2} = {2, 1} = {b, c}

{1, 2, 3} has 3 elements, what about {a, b, c}?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 10 / 41

Page 49: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 50: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 51: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 52: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 53: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ P

E.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 54: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 55: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 56: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beings

m is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 57: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 58: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 59: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 60: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZ

write x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 61: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Sets as Properties

Sets are used a lot in mathematical notation

Often, just as a short way of writing things

More specifically, that something has a property

E.g. “n is a prime number.”

In mathematics: n ∈ PE.g. “Martin is a human being”.

In mathematics, m ∈ H, where

H is the set of all human beingsm is Martin

One could define Prime(n), Human(m), etc. but that is not usual

Instead of writing “x has property XYZ ” or “XYZ (x)”,

let P be the set of all objects with property XYZwrite x ∈ P.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 11 / 41

Page 62: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

The Empty Set

Sometimes, you need a set that has no elements.

This is called the empty set

Notation: ∅ or {}

∅x 6∈ ∅, whatever x is!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 12 / 41

Page 63: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

The Empty Set

Sometimes, you need a set that has no elements.

This is called the empty set

Notation: ∅ or {}

∅x 6∈ ∅, whatever x is!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 12 / 41

Page 64: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

The Empty Set

Sometimes, you need a set that has no elements.

This is called the empty set

Notation: ∅ or {}

x 6∈ ∅, whatever x is!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 12 / 41

Page 65: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

The Empty Set

Sometimes, you need a set that has no elements.

This is called the empty set

Notation: ∅ or {}

∅x 6∈ ∅, whatever x is!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 12 / 41

Page 66: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 67: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 68: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 69: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 70: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 71: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}

{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 72: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}

P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 73: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N

∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 74: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 75: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Subsets

Let A and B be sets

if every element of A is also in B BA

then A is called a subset of B

This is writtenA ⊆ B

⊆Examples

{1} ⊆ {1, ‘a’,4}{1, 3} 6⊆ {1, 2}P ⊆ N∅ ⊆ A for any set A

A = B if and only if A ⊆ B and B ⊆ A

INF3580 :: Spring 2012 Lecture 5 :: 14th February 13 / 41

Page 76: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 77: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of A

all elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 78: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of B

also those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 79: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and B

and nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 80: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 81: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 82: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 83: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 84: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}

{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 85: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N

∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 86: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Union

The union of A and B contains

A B

A ∪ B

all elements of Aall elements of Balso those in both A and Band nothing more.

It is writtenA ∪ B

∪(A cup which you pour everything into)

Examples

{1, 2} ∪ {2, 3} = {1, 2, 3}{1, 3, 5, 7, 9, . . .} ∪ {2, 4, 6, 8, 10, . . .} = N∅ ∪ {1, 2} = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 14 / 41

Page 87: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 88: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of A

that are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 89: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in B

and nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 90: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 91: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 92: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 93: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}

P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 94: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}

∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 95: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Intersection

The intersection of A and B contains

A B

A ∩ B

those elements of Athat are also in Band nothing more.

It is writtenA ∩ B

∩Examples

{1, 2} ∩ {2, 3} = {2}P ∩ {2, 4, 6, 8, 10, . . .} = {2}∅ ∩ {1, 2} = ∅

INF3580 :: Spring 2012 Lecture 5 :: 14th February 15 / 41

Page 96: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 97: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of A

that are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 98: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in B

and nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 99: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 100: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\

Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 101: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 102: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}

N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 103: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}

∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 104: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅

{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 105: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Difference

The set difference of A and B contains

A B

A \ B

those elements of Athat are not in Band nothing more.

It is writtenA \ B

\Examples

{1, 2} \ {2, 3} = {1}N \ P = {1, 4, 6, 8, 9, 10, 12, . . .}∅ \ {1, 2} = ∅{1, 2} \ ∅ = {1, 2}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 16 / 41

Page 106: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 107: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 108: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }

The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 109: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 110: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 111: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers

{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 112: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}

{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 113: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Basic Set Algebra

Set Comprehensions

Sometimes enumerating all elements is not good enough

E.g. there are infinitely many, and “. . .” is too vague

Special notation:{x ∈ A | x has some property}

{· · · | · · · }The set of those elements of A which have the property.

Examples:

{n ∈ N | n = 2k for some k ∈ N}: the even numbers{n ∈ N | n < 5} = {1, 2, 3, 4}{x ∈ A | x 6∈ B} = A \ B

INF3580 :: Spring 2012 Lecture 5 :: 14th February 17 / 41

Page 114: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Outline

1 Basic Set Algebra

2 Pairs and Relations

3 Propositional Logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 18 / 41

Page 115: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Motivation

RDF is all about

Resources (objects)Their properties (rdf:type)Their relations amongst each other

Sets are good to group objects with some properties!

How do we talk about relations between objects?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 19 / 41

Page 116: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Motivation

RDF is all about

Resources (objects)

Their properties (rdf:type)Their relations amongst each other

Sets are good to group objects with some properties!

How do we talk about relations between objects?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 19 / 41

Page 117: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Motivation

RDF is all about

Resources (objects)Their properties (rdf:type)

Their relations amongst each other

Sets are good to group objects with some properties!

How do we talk about relations between objects?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 19 / 41

Page 118: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Motivation

RDF is all about

Resources (objects)Their properties (rdf:type)Their relations amongst each other

Sets are good to group objects with some properties!

How do we talk about relations between objects?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 19 / 41

Page 119: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Motivation

RDF is all about

Resources (objects)Their properties (rdf:type)Their relations amongst each other

Sets are good to group objects with some properties!

How do we talk about relations between objects?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 19 / 41

Page 120: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Motivation

RDF is all about

Resources (objects)Their properties (rdf:type)Their relations amongst each other

Sets are good to group objects with some properties!

How do we talk about relations between objects?

INF3580 :: Spring 2012 Lecture 5 :: 14th February 19 / 41

Page 121: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Pairs

A pair is an ordered collection of two objects

Written〈x , y〉 〈· · · 〉

Equal if components are equal:

〈a, b〉 = 〈x , y〉 if and only if a = x and b = y

Order matters:〈1, ‘a’〉 6= 〈‘a’, 1〉

An object can be twice in a pair:

〈1, 1〉

〈x , y〉 is a pair, no matter if x = y or not.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 20 / 41

Page 122: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Pairs

A pair is an ordered collection of two objects

Written〈x , y〉 〈· · · 〉

Equal if components are equal:

〈a, b〉 = 〈x , y〉 if and only if a = x and b = y

Order matters:〈1, ‘a’〉 6= 〈‘a’, 1〉

An object can be twice in a pair:

〈1, 1〉

〈x , y〉 is a pair, no matter if x = y or not.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 20 / 41

Page 123: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Pairs

A pair is an ordered collection of two objects

Written〈x , y〉 〈· · · 〉

Equal if components are equal:

〈a, b〉 = 〈x , y〉 if and only if a = x and b = y

Order matters:〈1, ‘a’〉 6= 〈‘a’, 1〉

An object can be twice in a pair:

〈1, 1〉

〈x , y〉 is a pair, no matter if x = y or not.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 20 / 41

Page 124: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Pairs

A pair is an ordered collection of two objects

Written〈x , y〉 〈· · · 〉

Equal if components are equal:

〈a, b〉 = 〈x , y〉 if and only if a = x and b = y

Order matters:〈1, ‘a’〉 6= 〈‘a’, 1〉

An object can be twice in a pair:

〈1, 1〉

〈x , y〉 is a pair, no matter if x = y or not.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 20 / 41

Page 125: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Pairs

A pair is an ordered collection of two objects

Written〈x , y〉 〈· · · 〉

Equal if components are equal:

〈a, b〉 = 〈x , y〉 if and only if a = x and b = y

Order matters:〈1, ‘a’〉 6= 〈‘a’, 1〉

An object can be twice in a pair:

〈1, 1〉

〈x , y〉 is a pair, no matter if x = y or not.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 20 / 41

Page 126: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Pairs

A pair is an ordered collection of two objects

Written〈x , y〉 〈· · · 〉

Equal if components are equal:

〈a, b〉 = 〈x , y〉 if and only if a = x and b = y

Order matters:〈1, ‘a’〉 6= 〈‘a’, 1〉

An object can be twice in a pair:

〈1, 1〉

〈x , y〉 is a pair, no matter if x = y or not.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 20 / 41

Page 127: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }

Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 128: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }

Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 129: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×

Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }

Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 130: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 131: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.

A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }

Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 132: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }

Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 133: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 134: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 135: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 136: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

The Cross Product

Let A and B be sets.

Construct the set of all pairs 〈a, b〉 with a ∈ A and b ∈ B.

This is called the cross product of A and B, written

A× B ×Example:

A = {1, 2, 3}, B = {‘a’, ‘b’}.A× B = { 〈1, ‘a’〉 , 〈2, ‘a’〉 , 〈3, ‘a’〉 ,

〈1, ‘b’〉 , 〈2, ‘b’〉 , 〈3, ‘b’〉 }Why bother?

Instead of “〈a, b〉 is a pair of a natural number and a person in this room”. . .

. . . 〈a, b〉 ∈ N× P3580

But most of all, there are subsets of cross products. . .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 21 / 41

Page 137: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 138: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 139: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ R

Example:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 140: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 141: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}

Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 142: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 143: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 144: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Relations

A relation R between two sets A and B is. . .

. . . a set of pairs 〈a, b〉 ∈ A× BR ⊆ A× B

We often write aRb to say that 〈a, b〉 ∈ RExample:

Let L = {‘a’, ‘b’, . . . , ‘z’}Let . relate each number between 1 and 26 to the corresponding letter in the alphabet:

1 . ’a’ 2 . ’b’ . . . 26 . ’z’

Then . ⊆ N× L:. = {〈1, ‘a’〉 , 〈2, ‘b’〉 , . . . , 〈26, ‘z’〉}

And we can write:〈1, ‘a’〉 ∈ . 〈2, ‘b’〉 ∈ . . . . 〈26, ‘z’〉 ∈ .

INF3580 :: Spring 2012 Lecture 5 :: 14th February 22 / 41

Page 145: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

More Relations

A relation R on some set A is a relation between A and A:

R ⊆ A× A = A2

Example: <

Consider the < order on natural numbers:

1 < 2 1 < 3 1 < 4 . . . 2 < 3 2 < 4 . . .

< ⊆ N× N:< = { 〈1, 2〉 〈1, 3〉 〈1, 4〉 . . .

〈2, 3〉 〈2, 4〉 . . .〈3, 4〉 . . .

. . . }

< = {〈x , y〉 ∈ N2 | x < y}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 23 / 41

Page 146: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

More Relations

A relation R on some set A is a relation between A and A:

R ⊆ A× A = A2

Example: <

Consider the < order on natural numbers:

1 < 2 1 < 3 1 < 4 . . . 2 < 3 2 < 4 . . .

< ⊆ N× N:< = { 〈1, 2〉 〈1, 3〉 〈1, 4〉 . . .

〈2, 3〉 〈2, 4〉 . . .〈3, 4〉 . . .

. . . }

< = {〈x , y〉 ∈ N2 | x < y}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 23 / 41

Page 147: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

More Relations

A relation R on some set A is a relation between A and A:

R ⊆ A× A = A2

Example: <

Consider the < order on natural numbers:

1 < 2 1 < 3 1 < 4 . . . 2 < 3 2 < 4 . . .

< ⊆ N× N:< = { 〈1, 2〉 〈1, 3〉 〈1, 4〉 . . .

〈2, 3〉 〈2, 4〉 . . .〈3, 4〉 . . .

. . . }

< = {〈x , y〉 ∈ N2 | x < y}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 23 / 41

Page 148: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

More Relations

A relation R on some set A is a relation between A and A:

R ⊆ A× A = A2

Example: <

Consider the < order on natural numbers:

1 < 2 1 < 3 1 < 4 . . . 2 < 3 2 < 4 . . .

< ⊆ N× N:< = { 〈1, 2〉 〈1, 3〉 〈1, 4〉 . . .

〈2, 3〉 〈2, 4〉 . . .〈3, 4〉 . . .

. . . }

< = {〈x , y〉 ∈ N2 | x < y}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 23 / 41

Page 149: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

More Relations

A relation R on some set A is a relation between A and A:

R ⊆ A× A = A2

Example: <

Consider the < order on natural numbers:

1 < 2 1 < 3 1 < 4 . . . 2 < 3 2 < 4 . . .

< ⊆ N× N:< = { 〈1, 2〉 〈1, 3〉 〈1, 4〉 . . .

〈2, 3〉 〈2, 4〉 . . .〈3, 4〉 . . .

. . . }

< = {〈x , y〉 ∈ N2 | x < y}

INF3580 :: Spring 2012 Lecture 5 :: 14th February 23 / 41

Page 150: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Family Relations

Consider the set S = {Homer,Marge,Bart, Lisa,Maggie}.

Define a relation P on S such that

x P y iff x is parent of y

For instance:Homer P Bart Marge P Maggie

As a set of pairs:

P = { 〈Homer,Bart〉 , 〈Homer, Lisa〉 , 〈Homer,Maggie〉 ,〈Marge,Bart〉 , 〈Marge, Lisa〉 , 〈Marge,Maggie〉 } ⊆ S2

For instance:〈Homer,Bart〉 ∈ P 〈Marge,Maggie〉 ∈ P

INF3580 :: Spring 2012 Lecture 5 :: 14th February 24 / 41

Page 151: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Family Relations

Consider the set S = {Homer,Marge,Bart, Lisa,Maggie}.Define a relation P on S such that

x P y iff x is parent of y

For instance:Homer P Bart Marge P Maggie

As a set of pairs:

P = { 〈Homer,Bart〉 , 〈Homer, Lisa〉 , 〈Homer,Maggie〉 ,〈Marge,Bart〉 , 〈Marge, Lisa〉 , 〈Marge,Maggie〉 } ⊆ S2

For instance:〈Homer,Bart〉 ∈ P 〈Marge,Maggie〉 ∈ P

INF3580 :: Spring 2012 Lecture 5 :: 14th February 24 / 41

Page 152: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Family Relations

Consider the set S = {Homer,Marge,Bart, Lisa,Maggie}.Define a relation P on S such that

x P y iff x is parent of y

For instance:Homer P Bart Marge P Maggie

As a set of pairs:

P = { 〈Homer,Bart〉 , 〈Homer, Lisa〉 , 〈Homer,Maggie〉 ,〈Marge,Bart〉 , 〈Marge, Lisa〉 , 〈Marge,Maggie〉 } ⊆ S2

For instance:〈Homer,Bart〉 ∈ P 〈Marge,Maggie〉 ∈ P

INF3580 :: Spring 2012 Lecture 5 :: 14th February 24 / 41

Page 153: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Family Relations

Consider the set S = {Homer,Marge,Bart, Lisa,Maggie}.Define a relation P on S such that

x P y iff x is parent of y

For instance:Homer P Bart Marge P Maggie

As a set of pairs:

P = { 〈Homer,Bart〉 , 〈Homer, Lisa〉 , 〈Homer,Maggie〉 ,〈Marge,Bart〉 , 〈Marge, Lisa〉 , 〈Marge,Maggie〉 } ⊆ S2

For instance:〈Homer,Bart〉 ∈ P 〈Marge,Maggie〉 ∈ P

INF3580 :: Spring 2012 Lecture 5 :: 14th February 24 / 41

Page 154: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Family Relations

Consider the set S = {Homer,Marge,Bart, Lisa,Maggie}.Define a relation P on S such that

x P y iff x is parent of y

For instance:Homer P Bart Marge P Maggie

As a set of pairs:

P = { 〈Homer,Bart〉 , 〈Homer, Lisa〉 , 〈Homer,Maggie〉 ,〈Marge,Bart〉 , 〈Marge, Lisa〉 , 〈Marge,Maggie〉 } ⊆ S2

For instance:〈Homer,Bart〉 ∈ P 〈Marge,Maggie〉 ∈ P

INF3580 :: Spring 2012 Lecture 5 :: 14th February 24 / 41

Page 155: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 156: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 157: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 158: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.

E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 159: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 160: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 161: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .

E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 162: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 163: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 164: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R z

E.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 165: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Pairs and Relations

Special Kinds of Relations

Certain properties of relations occur in many applications

Therefore, they are given names

R ⊆ A2 is reflexive

x R x for all x ∈ A.E.g. “=”, “≤” in mathematics, “has same color as”, etc.

R ⊆ A2 is symmetric

If x R y then y R x .E.g. “=” in mathematics, friendship in facebook, etc.

R ⊆ A2 is transitive

If x R y and y R z , then x R zE.g. “=”, “≤”, “<” in mathematics, “is ancestor of”, etc.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 25 / 41

Page 166: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Outline

1 Basic Set Algebra

2 Pairs and Relations

3 Propositional Logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 26 / 41

Page 167: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 168: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)

description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 169: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)

modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 170: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )

first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 171: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 172: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 173: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 174: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)

Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 175: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 176: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?

model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 177: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 178: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 179: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 180: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Many Kinds of Logic

In mathematical logic, many kinds of logic are considered

propositional logic (and, or, not)description logic (a mother is a person who is female and has a child)modal logic (Alice knows that Bob didn’t know yesterday that. . . )first-order logic (For all. . . , for some. . . )

All of them formalizing different aspects of reasoning

All of them defined mathematically

Syntax (≈ grammar. What is a formula?)Semantics (What is the meaning?)

proof theory: what is legal reasoning?model semantics: declarative using set theory.

For semantic technologies, description logic (DL) is most interesting

talks about sets and relations

Basic concepts can be explained using predicate logic

INF3580 :: Spring 2012 Lecture 5 :: 14th February 27 / 41

Page 181: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬

(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 182: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬

(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 183: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬

(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 184: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬(A ∧ B) is also a formula (read: “A and B”)

(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 185: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)

¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 186: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 187: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 188: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 189: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Logic: Formulas

Formulas are defined “by induction” or “recursively”:

1 Any letter p, q, r ,. . . is a formula

2 if A and B are formulas, then ∧ ∨ ¬(A ∧ B) is also a formula (read: “A and B”)(A ∨ B) is also a formula (read: “A or B”)¬A is also a formula (read: “not A”)

Nothing else is. Only what rules [1] and [2] say is a formula.

Examples of formulae:

p (p ∧ ¬r) (q ∧ q) (q ∧ ¬q) ((p ∨ ¬q) ∧ (¬p ∧ q))

Examples of non-formulas:pqr p¬q ∧ (p

INF3580 :: Spring 2012 Lecture 5 :: 14th February 28 / 41

Page 190: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:

The set of all formulas Φ is the least set such that1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 191: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 192: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ

2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 193: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 194: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ

(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 195: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ

¬A ∈ ΦFormulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 196: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 197: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:

no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 198: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:no meaning

but every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 199: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Propositional Formulas, Using Sets

Definition using sets:The set of all formulas Φ is the least set such that

1 All letters p, q, r , . . . ∈ Φ2 if A,B ∈ Φ, then

(A ∧ B) ∈ Φ(A ∨ B) ∈ Φ¬A ∈ Φ

Formulas are just a kind of strings until now:no meaningbut every formula can be “parsed” uniquely.

((q ∧ p) ∨ (p ∧ q))

q p

p q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 29 / 41

Page 200: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 201: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 202: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 203: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 204: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 205: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 206: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 207: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 208: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Truth

Logic is about things being true or false, right?

Is (p ∧ q) true?

That depends on whether p and q are true!

If p is true, and q is true, then p ∧ q is true

Otherwise, (p ∧ q) is false.

So truth of a formula depends on the truth of the letters

We also say the “interpretation” of the letters

In other words, in general, truth depends on the context

Let’s formalize this context, a.k.a. interpretation

INF3580 :: Spring 2012 Lecture 5 :: 14th February 30 / 41

Page 209: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Interpretations

Idea: put all letters that are “true” into a set!

Define: An interpretation I is a set of letters.

Letter p is true in interpretation I if p ∈ I.

E.g., in I1 = {p, q}, p is true, but r is false. p rq

I1

I2

But in I2 = {q, r}, p is false, but r is true.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 31 / 41

Page 210: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Interpretations

Idea: put all letters that are “true” into a set!

Define: An interpretation I is a set of letters.

Letter p is true in interpretation I if p ∈ I.

E.g., in I1 = {p, q}, p is true, but r is false. p rq

I1

I2

But in I2 = {q, r}, p is false, but r is true.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 31 / 41

Page 211: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Interpretations

Idea: put all letters that are “true” into a set!

Define: An interpretation I is a set of letters.

Letter p is true in interpretation I if p ∈ I.

E.g., in I1 = {p, q}, p is true, but r is false. p rq

I1

I2

But in I2 = {q, r}, p is false, but r is true.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 31 / 41

Page 212: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Interpretations

Idea: put all letters that are “true” into a set!

Define: An interpretation I is a set of letters.

Letter p is true in interpretation I if p ∈ I.

E.g., in I1 = {p, q}, p is true, but r is false. p rq

I1

I2

But in I2 = {q, r}, p is false, but r is true.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 31 / 41

Page 213: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Interpretations

Idea: put all letters that are “true” into a set!

Define: An interpretation I is a set of letters.

Letter p is true in interpretation I if p ∈ I.

E.g., in I1 = {p, q}, p is true, but r is false. p rq

I1 I2

But in I2 = {q, r}, p is false, but r is true.

INF3580 :: Spring 2012 Lecture 5 :: 14th February 31 / 41

Page 214: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Semantic Validity |=

To say that p is true in I, writeI |= p |=

For instance

p rq

I1 I2

I1 |= p I2 6|= p

In other words, for all letters p:

I |= p if and only if p ∈ I

INF3580 :: Spring 2012 Lecture 5 :: 14th February 32 / 41

Page 215: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Semantic Validity |=

To say that p is true in I, writeI |= p |=

For instance

p rq

I1 I2

I1 |= p I2 6|= p

In other words, for all letters p:

I |= p if and only if p ∈ I

INF3580 :: Spring 2012 Lecture 5 :: 14th February 32 / 41

Page 216: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Semantic Validity |=

To say that p is true in I, writeI |= p |=

For instance

p rq

I1 I2

I1 |= p I2 6|= p

In other words, for all letters p:

I |= p if and only if p ∈ I

INF3580 :: Spring 2012 Lecture 5 :: 14th February 32 / 41

Page 217: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 218: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 219: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 220: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 221: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 222: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 223: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas

So, is (p ∧ q) true?

That depends on whether p and q are true!

And that depends on the interpretation.

All right then, given some I, is (p ∧ q) true?

Yes, if I |= p and I |= q

No, otherwise

For instance

p rq

I1 I2

I1 |= p ∧ q I2 6|= p ∧ q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 33 / 41

Page 224: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 225: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 226: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 227: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 228: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 229: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 230: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Validity of Compound Formulas, cont.

That was easy, p and q are only letters. . .

. . . so, is ((q ∧ r) ∧ (p ∧ q)) true in I?

Idea: apply our rule recursively

For any formulas A and B,. . .

. . . and any interpretation I,. . .

. . . I |= A ∧ B if and only if I |= A and I |= B

For instance

p rq

I1

I1 6|= ((q ∧ r) ∧ (p ∧ q))

I1 6|= (q ∧ r)

I1 |= q I1 6|= r

I1 |= (p ∧ q)

I1 |= p I1 |= q

INF3580 :: Spring 2012 Lecture 5 :: 14th February 34 / 41

Page 231: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Semantics for ¬ and ∨

The complete definition of |= is as follows:

For any interpretation I, letter p, formulas A,B:

I |= p iff p ∈ II |= ¬A iff I 6|= AI |= (A ∧ B) iff I |= A and I |= BI |= (A ∨ B) iff I |= A or I |= B (or both)

Semantics of ¬, ∧, ∨ often given as truth table:

A B ¬A A ∧ B A ∨ B

f f t f ff t t f tt f f f tt t f t t

INF3580 :: Spring 2012 Lecture 5 :: 14th February 35 / 41

Page 232: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Some Formulas Are Truer Than Others

Is (p ∨ ¬p) true?

Only two interesting interpretations:

I1 = ∅ I2 = {p}

Recursive Evaluation:

I1 |= (p ∨ ¬p)

I1 6|= p I1 |= ¬p

I1 6|= p

I2 |= (p ∨ ¬p)

I2 |= p I2 6|= ¬p

I2 |= p

(p ∨ ¬p) is true in all interpretations!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 36 / 41

Page 233: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Some Formulas Are Truer Than Others

Is (p ∨ ¬p) true?

Only two interesting interpretations:

I1 = ∅ I2 = {p}

Recursive Evaluation:

I1 |= (p ∨ ¬p)

I1 6|= p I1 |= ¬p

I1 6|= p

I2 |= (p ∨ ¬p)

I2 |= p I2 6|= ¬p

I2 |= p

(p ∨ ¬p) is true in all interpretations!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 36 / 41

Page 234: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Some Formulas Are Truer Than Others

Is (p ∨ ¬p) true?

Only two interesting interpretations:

I1 = ∅ I2 = {p}

Recursive Evaluation:

I1 |= (p ∨ ¬p)

I1 6|= p I1 |= ¬p

I1 6|= p

I2 |= (p ∨ ¬p)

I2 |= p I2 6|= ¬p

I2 |= p

(p ∨ ¬p) is true in all interpretations!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 36 / 41

Page 235: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Some Formulas Are Truer Than Others

Is (p ∨ ¬p) true?

Only two interesting interpretations:

I1 = ∅ I2 = {p}

Recursive Evaluation:

I1 |= (p ∨ ¬p)

I1 6|= p I1 |= ¬p

I1 6|= p

I2 |= (p ∨ ¬p)

I2 |= p I2 6|= ¬p

I2 |= p

(p ∨ ¬p) is true in all interpretations!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 36 / 41

Page 236: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 237: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 238: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 239: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 240: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 241: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 242: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.

Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 243: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.

The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 244: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 245: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 246: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Tautologies

A formula A that is true in all interpretations is called a tautology

also logically valid

also a theorem (of propositional logic)

written:|= A

(p ∨ ¬p) is a tautology

True whatever p means:

The sky is blue or the sky is not blue.Petter N. will win the race or Peter N. will not win the race.The slithy toves gyre or the slithy toves do not gyre.

Possible to derive true statements mechanically. . .

. . . without understanding their meaning!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 37 / 41

Page 247: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Checking Tautologies

Checking whether |= A is the task of SAT-solving

(co-)NP-complete in general (i.e. in practice exponential time)

Small instances can be checked with a truth table:

|= (¬p ∨ (¬q ∨ (p ∧ q))) ?

p q ¬p ¬q (p ∧ q) (¬q ∨ (p ∧ q)) (¬p ∨ (¬q ∨ (p ∧ q)))f f t t f t tf t t f f f tt f f t f t tt t f f t t t

Therefore: (¬p ∨ (¬q ∨ (p ∧ q))) is a tautology!

INF3580 :: Spring 2012 Lecture 5 :: 14th February 38 / 41

Page 248: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 249: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 250: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 251: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= B

for all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 252: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 253: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 254: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 255: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 256: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:

If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 257: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:If it rains and the sky is blue, then it rains

If P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 258: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the race

If ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 259: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Entailment

Tautologies are true in all interpretations

Some Formulas are true only under certain assumptions

A entails B, written A |= B if

I |= Bfor all interpretations I with I |= A

Also: “B is a logical consequence of A”

Whenever A holds, also B holds

For instance:p ∧ q |= p

Independent of meaning of p and q:If it rains and the sky is blue, then it rainsIf P.N. wins the race and the world ends, then P.N. wins the raceIf ’tis brillig and the slythy toves do gyre, then ’tis brillig

INF3580 :: Spring 2012 Lecture 5 :: 14th February 39 / 41

Page 260: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Checking Entailment

SAT solvers can be used to check entailment:

A |= B if and only if |= (¬A ∨ B)

We can check simple cases with a truth table:

(p ∧ ¬q) |= ¬(¬p ∨ q) ?

p q ¬p ¬q (p ∧ ¬q) (¬p ∨ q) ¬(¬p ∨ q)

f f t t f t ff t t f f t ft f f t t f tt t f f f t f

So (p ∧ ¬q) |= ¬(¬p ∨ q)

And ¬(¬p ∨ q) |= (p ∧ ¬q)

INF3580 :: Spring 2012 Lecture 5 :: 14th February 40 / 41

Page 261: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Checking Entailment

SAT solvers can be used to check entailment:

A |= B if and only if |= (¬A ∨ B)

We can check simple cases with a truth table:

(p ∧ ¬q) |= ¬(¬p ∨ q) ?

p q ¬p ¬q (p ∧ ¬q) (¬p ∨ q) ¬(¬p ∨ q)

f f t t f t ff t t f f t ft f f t t f tt t f f f t f

So (p ∧ ¬q) |= ¬(¬p ∨ q)

And ¬(¬p ∨ q) |= (p ∧ ¬q)

INF3580 :: Spring 2012 Lecture 5 :: 14th February 40 / 41

Page 262: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Checking Entailment

SAT solvers can be used to check entailment:

A |= B if and only if |= (¬A ∨ B)

We can check simple cases with a truth table:

(p ∧ ¬q) |= ¬(¬p ∨ q) ?

p q ¬p ¬q (p ∧ ¬q) (¬p ∨ q) ¬(¬p ∨ q)

f f t t f t ff t t f f t ft f f t t f tt t f f f t f

So (p ∧ ¬q) |= ¬(¬p ∨ q)

And ¬(¬p ∨ q) |= (p ∧ ¬q)

INF3580 :: Spring 2012 Lecture 5 :: 14th February 40 / 41

Page 263: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Checking Entailment

SAT solvers can be used to check entailment:

A |= B if and only if |= (¬A ∨ B)

We can check simple cases with a truth table:

(p ∧ ¬q) |= ¬(¬p ∨ q) ?

p q ¬p ¬q (p ∧ ¬q) (¬p ∨ q) ¬(¬p ∨ q)

f f t t f t ff t t f f t ft f f t t f tt t f f f t f

So (p ∧ ¬q) |= ¬(¬p ∨ q)

And ¬(¬p ∨ q) |= (p ∧ ¬q)

INF3580 :: Spring 2012 Lecture 5 :: 14th February 40 / 41

Page 264: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Sets

are collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relations

are sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 265: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicity

often used to gather objects which have some propertycan be combined using ∩,∪, \

Relations

are sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 266: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some property

can be combined using ∩,∪, \Relations

are sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 267: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relations

are sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 268: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relations

are sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 269: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)

x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 270: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ R

can be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 271: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 272: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logic

has formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 273: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)

which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 274: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)

interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 275: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of letters

recursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 276: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬

|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 277: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)

A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 278: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)

truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41

Page 279: INF3580 { Semantic Technologies { Spring 2012€¦ · 14th February 2012 Department of Informatics University of Oslo. Sommerjobb ved FFI Sommerjobber ved Forsvarets Forskningsinstitutt

Propositional Logic

Recap

Setsare collections of objects without order or multiplicityoften used to gather objects which have some propertycan be combined using ∩,∪, \

Relationsare sets of pairs (subset of cross product A× B)x R y is the same as 〈x , y〉 ∈ Rcan be (any combination of) symmetric, reflexive, transitive

Predicate Logichas formulas built from letters, ∧, ∨, ¬ (syntax)which can be evaluated in an interpretation (semantics)interpretations are sets of lettersrecursive definition for semantics of ∧,∨,¬|= A if I |= A for all I (tautology)A |= B if I |= B for all I with I |= A (entailment)truth tables can be used for checking

INF3580 :: Spring 2012 Lecture 5 :: 14th February 41 / 41


Recommended