speech & nlp (fall 2014): formal knowledge representation & semantics

Post on 28-May-2015

207 Views

Category:

Science

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Speech & NLP

www.vkedco.blogspot.com

Knowledge Representation & Semantics

Conceptualization, Syntax & Semantics of First-Order Predicate Calculus,

Interpretation, Variable Assignment, Satisfaction

Vladimir Kulyukin

Department of Computer Science

Utah State University

Outline

● Conceptualization

● First-Order Predicate Calculus

– Syntax

– Semantics: Interpretation, Variable Assignment, Satisfaction

● Natural Language Examples

Introduction

● Intelligent behavior depends on an agent’s knowledge about

its world

● This knowledge is, to a great extent, descriptive (declarative)

● If this knowledge is to be used by a computer, this descriptive

knowledge must be formalized

● Knowledge representation is an area of AI the studies

methods to formalize the existing bodies of knowledge

What Does this Agent Need to Act in the World?

World

Agent

Agent Needs Conceptualization. What Else?

Conceptualization

World

Some ideas about how the world works

Agent

The Agent Needs Some Place to Store Knowledge

Conceptualization

World Knowledge Repository Some accessible place to store knowledge

Agent

Some ideas about how the world works

The Agent Needs a Way to Write Knowledge Down

Conceptualization

World Knowledge Repository Some accessible place to store knowledge

Agent

Some ideas about how the world works

Agents need formalisms to encode & manipulate

knowledge about the world.

Fundamental Tenet of Symbolic AI

Conceptualization

Objects & Relations

● Knowledge formalization begins with a conceptualization of the

world

● Conceptualization, generally speaking, analyzes the world in terms of

objects and relations

● Functions are also relations

● Objects can be concrete (book, pen, block) or abstract (number 2,

honesty, love)

● Objects can be primitive (number 2) or abstract (algebraic

expression)

Universe of Discourse

● It is impossible for any conceptualization to include all objects in the world

● Conceptualizations reside inside observers (human or mechanical) and

include only those objects that present some interest to the observers

● Beekeepers conceptualize the world in terms bees, swarms, beehives, honey

extractors, bee disease treatments, etc

● Number theorists conceptualize the world in terms of numbers, sets, properties

of numbers, etc.

● The set of objects covered by a conceptualization is called the universe of

discourse

Functions & Relations

● Once a conceptualization has objects, the observer must

establish relations among those objects

● There are two types of relations most conceptualizations

contain: functions and relations

● A set of functions in the conceptualization is called functional

basis

● A set of relations in the conceptualization is called relational

basis

Blocks World

A

A

A

A

A

A

c

b

a

d

e

Which objects do you conceptualize in this world?

Blocks World: Objects

A

A

A

A

A

A

c

b

a

d

e

Many human observers conceptualize five blocks {a, b, c, d, e}

}and the table t

Blocks World: Objects

A

A

A

A

A

A

c

b

a

d

e

One can conceptualize five blocks {a, b, c, d, e} and the table t

Blocks World: Functions & Relations

A

A

A

A

A

A

c

b

a

d

e

What functions & relations do you see in this world?

Blocks World: Functions & Relations

A

A

A

A

A

A

c

b

a

d

e

We can define the partial function hat that maps a block into the block on top of

it. Formally, hat consists of the following tuples: hat: {<b, a>, <c, b>, <e, d>}

Blocks World: Functions & Relations

A

A

A

A

A

A

c

b

a

d

e

We can define the relations on or above with the obvious interpretations. Formally, these

relations consist of the following tuples:

on: {<a, b>, <b, c>, <d, e>}

above: {<a, b>, <b, c>, <a, c>, <d, e>}

Blocks World: Functions & Relations

A

A

A

A

A

A

c

b

a

d

e

We can define the relation clear that holds for a block if and only if there is no block on top of

it: clear: {a, d}

Blocks World: One Conceptualization

A

A

A

A

A

A

c

b

a

d

e

.,,,,,,,, clearaboveonhatedcba

Upper Bound on Number of N-ary Relations

subsets. possible 2 are There tuples.- theseofsubset a

isrelation ary -Every tuples.-distinct are There

objects. contains Discourse of Universe theSuppose

nO

n

n

nnO

O

Notes on Conceptualizations

● Conceptualizations, although they are written down, consists

of the objects and relations the observer actually sees in

the world

● The same world may have multiple conceptualizations (e.g.,

blocks world can be conceptualized in terms of line segments,

curves, and their relations)

● Different conceptualizations allow/inhibit certain kinds of

knowledge (light as a wave vs. light as a particle; geocentric

vs. heliocentric universe)

Realism vs. Nominalism

● Realism takes a stand that objects & relations in one’s

conceptualization really exist in the world

● Nominalism takes a stand that objects & relations in

one’s conceptualization do not necessarily exist in the

world

● AI takes a standpoint that conceptualizations are

justified by their utility to the system (this is, strictly

speaking, neither realism nor nominalism)

Brief Introduction

to

First-Order Predicate Calculus

Alphabets & Symbols

● Since FOPC is a formal language, it must start with an

alphabet

● Chapter 2 in Logical Foundations of AI contains one such

alphabet (typically it consists of the standard ASCII

augmented with specific mathematical symbols)

● FOPC has two types of symbols: variables and constants

● Constants consists of object constants, function

constants, and relation constants

Variables & Constants

● A variable is a sequence of lowercase alphanumeric characters and numeric characters

such that the first character is lowercase alphabetic

● An object constant names a specific element in the universe of discourse and is a

sequence of alphabetic characters or digits such that the first character is either uppercase

alphabetic or digit

● A function constant names a function on the members of the universe of discourse and is

a mathematical operator or a sequence of alphabetic characters or digits in which the first

character is uppercase alphabetic

● A relation constant names a relation on the members of the universe of discourse and is a

mathematical operator or a sequence of alphabetic characters or digits in which the first

character is uppercase alphabetic

Variables & Constants: Examples

● Variables: x, y, z, x10, y15, z500

● Object constants: Logan, Aristotle, Hallway100

● Function constants: Age, Cosine, Tangent, +, -, *

● Relation constants: Above, Clear, Below

Terms

● A term is an object’s name

● A term can be a variable, an object constant, or a

functional expression

● A functional expression is an expression of the form

f(t1, t2, …, tn) , where f is an n-ary function constant

and are t1, t2, …, tn terms (this is a recursive definition)

Terms: Examples

● A, B, C, D, E are object constants and, therefore, terms

● Hat is a function constant

● Hat(C) is a term (functional expression)

● Hat(Hat(C)) is a term (functional expression)

● Hat(x) is a term (functional expression)

● Hat(Hat(x)) is a term (functional expression)

Well-Formed Formulas (WFFs)

● In FOPC, facts are stated in sentences (aka well-

formed formulas or wffs)

● Three types of sentences:

– Atomic sentences (aka atoms);

– Logical sentences;

– Quantified sentences

Atoms

at(C))Above(A, H

Hat(C))On(Hat(B),

On(A, B)

tttt nn

:Examples

termsare ,..., andconstant relation a is where,,..., 11

Atoms

21

21

21

:Examples atoms. are sexpression

subset es,inequaliti ,equalities almathematic All

tt

tt

tt

Logical Sentences

atomsor sentences logical are , where,:eequivalenc 6.

atomsor sentences logical are , where, :nimplicatio reverse 5.

atomsor sentences logical are , where, :nimplicatio 4.

atomor sentence logical a is ,... :ndisjunctio 3.

atomor sentence logical a is ,... :nconjunctio 2.

sentence logical a is where :negation 1.

sentences. logicalother or

atoms tooperators logical applyingby formed are sentences Logical

11

11

nin

nin

Logical Sentences: Examples

AEOnADOnACOnABOnAClear

yxOnyxAbove

yxAboveyxOn

xxHatAbovexxHatAbove

EDAboveBAOn

BAOn

,,,, 6.

,, 5.

,, 4.

,, 3.

,, 2.

, 1.

sentences. logicalother or atoms to

operators logical applyingby formed are sentences Logical

Quantified Sentences

vTablevBlockv

vBlockvBluev

vBlockvBluev

xBlockxBluex

vv

vv

:Examples

sentence a is and

variablea is where :tionquantifica lexistentia 2.

sentence a is and

variablea is where :tionquantifica universal 1.

s.quantifier lexistentiaor universal the

withsentencesother prefixingby formed are sentences Quantified

More Examples of Quantified Sentences

yxyx

yxyx

yxyx

yxLovesyx

yxLovesyx

yxLovesyx

,

,

,

Semantics

How Does the Agent Know What is True?

Conceptualization

World Knowledge Repository

Agent

Worlds, Conceptualizations, Knowledge

Repositories, & Agents

● Sentences are written in a knowledge repository (book, smartphone,

database, etc.)

● Conceptualizations of the world exist in the agent’s head (some true,

some false, some partially true)

● Truth of each sentence is evaluated with respect to a specific

conceptualization

● As the agent acts in the world, the agent may modify or abandon

conceptualizations or adopt new ones

Interpretation as a Function

● Interpretation is a mapping b/w the elements of a formal

language (FOPC in our case) and the elements of a

conceptualization

● Formally, an interpretation is the function I(σ) where σ is an

element of the language

● The value of I(σ) is an element of a given conceptualization

● The universe of discourse is denoted |I|

Formal Properties of Interpretation

constantrelation a is if ,

constantfunction a is if , :

constantobject an is if

n

n

II

III

II

Blocks World Interpretation I

daClearI

edcacbbaAboveI

edcbbaOnI

debcabHatI

eEIdDIcCIbBIaAI

,

,,,,,,,

,,,,,

,,,,,

;;;;;

Blocks World Interpretation J

daClearI

deacbcabAboveI

debcabOnJ

debcabHatJ

eEJdDJcCJbBJaAJ

Above

OnClear

HatIJ

,

,,,,,,,

,,,,,

,,,,,

;;;;;

:below'' as

and under'' as interpretsbut ,relation unary

and ,function constants,object on with agrees

Variable Assignment

CzUByUAxU

U

;;:Example

constants.object

to variablesmapping function a is assignment Variable

symbols.other from separately dinterprete are Variables

Term Interpretation

nIUii

n

IU

IU

IU

xxftTxtI

fIttt

tUtTt

tItTt

T

UI

,...,then ,

, and ,..., form theof terma is If .3

then variable,a is If .2

then constant,object an is If .1

:follows as defined

objects to termsmapping assignment terma is the

,assignment variablea is and tion,interpretaan is If

1

1

Term Interpretation: Example

then ,let

and ,previously definedtion interpreta theis If

bCHatwUHatIwHatT

CwU

I

IU

Satisfaction

General Notation

U

IU

U

IU

I

I

assignment variablea

and tion interpretaan under satisfiednot is Sentence:|

assignment variablea

and tion interpretaan under satisfied is Sentence:|

Case 1

2121 iff | tTtTUtt IUIUI

Case 2

edcacbbaAboveIcaCTAT

UCAAbove

edcacbbaAboveI

cCIaAI

ItTtTUtt

IUIU

I

nIUnIUI

,,,,,,,,,

because satisfied is ,|

,,,,,,,

;;

:Example

,..., iff ,...,| 21

Case 3

UttUtt II 2121 ,...,| iff ,...,|

Case 4

niUU iInI ,...,1,| iff ...| 1

Case 5

niUU iInI ,...,1 somefor ,| iff ...| 1

Case 6

UUU III 2121 | | iff |

Case 7

UUU III 122121 | | iff |

Case 8

.|,in with

replaced is after |,| allfor iff |

Ud

vIdUv

I

I

Case 9

Udv

IdUv

I

I

|,in with replaced is after

|,| somefor iff |

Examples

xPoisonousxMushroomxPurplex

xPoisonousxMushroomxPurplex

poisonous. are mushrooms purple All

Examples

xPurplexPoisonousxMushroomx

purple. isit ifonly poisonous is mushroomA

Examples

xPoisonousxMushroomxPurplex

xPoisonousxMushroomxPurplex

poisonous. is mushroom purple No

References

● Ch 02, M. Genesereth & N. Nilsson. Logical Foundations

of AI, Morgan Kaufmann

top related