Representing Knowledge Automated Reasoning We are faced with - - PowerPoint PPT Presentation

representing knowledge automated reasoning
SMART_READER_LITE
LIVE PREVIEW

Representing Knowledge Automated Reasoning We are faced with - - PowerPoint PPT Presentation

Representing Knowledge Automated Reasoning We are faced with several choices: which type of logic to use? e.g. First Order Logic Representing Knowledge Higher Order Logic axioms (to capture basic facts of domain) definitions:


slide-1
SLIDE 1

Representing Knowledge

We are faced with several choices:

which type of logic to use? e.g. First Order Logic Higher Order Logic axioms (to capture basic facts of domain) definitions: introduce other concepts in terms of basic facts

double x ≡ 2 × x

Other types of definitions e.g. Recursive:

0 x = x s x y = s x y

factorial 0 = 1 factorial s x = s x × factorial x

square x ≡ x × x

Base case Step case

s x ≡ x 1

Example Axioms: Equality

3=3, 4= 4 4=31, 31= 4 if a=b, b=c then a=c replace equals with equals

reflexivity x=x symmetry x=y→ y=x transitivity x=yy=z→ x=z replacement x1=y1...xn=yn→ f x1,... ,xn = f y1,... ,yn x1=y1...xn=ynP x1,... ,xn → P y1,... ,yn

Properties that we want: Existence: ∃ y. f x = y Uniqueness: f x = y f x =z → y=z Use reflexivity Use symmetry and transitivity Finite set of axioms

Automated Reasoning

Representing Knowledge Jacques Fleuriot

Lecture III

Introduction

Aim: to express knowledge in a computer tractable form Knowledge representation language, such as 1st order logic, defined by

syntax: what constitutes a legal sentence (formula) in language semantics: facts in the world to which sentences refer. Without

semantics, a sentence is just an arrangement of symbols.

sentences sentence facts fact entails follows semantics semantics representation world

Key point: Reasoning operates on representations of facts rather than on the facts themselves

slide-2
SLIDE 2

Sets

want to represent individual sets, including empty set need to be able to: build up sets by adding (adjoining) an element to a set taking the union of two sets taking the intersection of two sets tell whether an element is a member of a set distinguish sets from objects that are not sets Representation needs: Set predicate is true only of sets constant: EmptySet predicates: Member, Subset, and Set functions: Intersection, Union, and Adjoin

Example: Axioms of Set Theory

  • 1. The only sets are the empty set and those made by adjoining something

to a set.

  • 2. The empty set has no elements adjoined to it (i.e. EmptySet cannot

be decomposed into a smaller set and an element).

  • 3. Adjoining an element already in the set has no effect.
  • 4. The only members of a set are the elements that were adjoined to it.

∀ s. Set s

  • s=EmptySet ∃x s2.Set s2 s= Adjoin x,s2

∃x s. Adjoin x,s =EmptySet ∀ x s. Member x,s s= Adjoin x,s ∀ x s. Member x,s ∃s2 y. s= Adjoin y,s2 x= yMember x,s2

Groups: Examples

0 x = x x 0 = x x x = 0 x x = 0 x y z = x y z x1 = y1 → x1 =y1 x1 = y1 x2 = y2 → x1 x2 = y1 y2 1 × x = x x × 1 = x x × x

1 = 1

x

1 × x = 1

x × y × z = x × y × z x1 = y1 → x1

1 = y1 1

x1 = y1 x2 = y2 → x1× x2 = y1× y2 example domain: real numbers inverse of x = - x identity element: 0 binary function: + inverse of x = identity element: 1 binary function: × x

1

inv x

Example: Group Theory Axioms

identity ex=x xe=x inverse xx=e xx=e associativity x yz = x y z replacement x1=y1→x1=y1 x1=y1x2=y2→ x1x2=y1 y2

+ other equality axioms It is trivial to prove:

∃y.x=y e istheidentityelement isabinary function xisinverse of x

a constant

slide-3
SLIDE 3

Example: Natural Numbers Axiom of Mathematical Induction

P 0 ∀ x. P x → P s x ∀ x. P x

Induction Rule

Captures fact that all numbers are generated by a succession operation Property P holds if it holds for all numbers defined using successor function Second order axiom: P is a variable predicate Use it to prove many properties

Issues in representation

Understandability of representation: is it natural? Expressiveness

  • propositional, predicate, inductive ...
  • finite set of axioms?

How easy is it to reason with?

  • suitability of heuristics
  • user interaction

Granularity of representation

  • choice of primitives

e.g. Geometry: take points as primitive (Tarski)? take points, lines and planes (Hilbert)?

Example: Axioms of Set Theory

  • 5. A set is a subset of another if and only if all the members of the

first set are members of the second set.

  • 6. Two sets are equal if and only if each is a subset of the other.
  • 7. An object is a member of the intersection of two sets if and only

if it is a member of each of the sets.

  • 8. An object is a member of the union of two sets if and only if it is

a member of either set.

Exercise:

Example: Natural Numbers Axioms Peano Arithmetic

  • All natural numbers can be generated using successor function

4=s s s s 0

Convenient abbreviation

No need for an infinite number of constants: just have 0 and successor function s

∞ many numbers ¬ 0=s x s x =s y → x= y addition 0x=x s x y=s x y multiplication 0⋅x=0 s x ⋅y=x⋅y y + equality axioms + ????

slide-4
SLIDE 4

Function-free universal fragment

Only use predicates and no existential quantifiers arguments in such theories are essentially boolean therefore, only need to test a finite number of variable-free,

quantifier free formulae for tautologyhood

can use techniques of propositional logic

Represent

f X 1,..., X n =Y as p f X 1,..., X n,Y X Y =Z as X,Y, Z X=Y as inv X,Y

Example: functions from group theory

Group theory axioms revisited

identity e,x,x x,e,x inverse inv x, y → x, y,e y,x,e associativity x, y,u u,z,w y,z,v → x,v,w y,z,v x,v,w x, y,u → u,z,w

+ replacement axioms Disadvantages? Not all theorems of group theory can be proved since resulting theory is too weak, e.g. ∀ x .∃ y . inv x,y cannot be proved

Functions or Relations?

Represent some property r holding between two objects x and y use a function and equality? use a relation (predicate)?

r x =y r x, y

Equality axioms give functional representation the following properties: Existence ∃ Y . r X = Y Uniqueness r X = Y r X = Z → Y = Z Problem? There may be no such Y, or there may be more than one So, use relational form

Example

Consider ''daughter of" property: Can we express it as a function? e.g. daughter_of (marge) = lisa But Marge has another daughter called Maggie. uniqueness would mean that lisa = maggie

  • daughter_of is not a function but a relation: daughter_of (marge , lisa)
  • mum_of is a function: So, mum_of (lisa) = marge is okay

Another example loves (bill, monica) loves (bill, hilary), ... loves_em (bill) = {hilary, monica, janet ...}

Represent a relation as a function by introducing sets and using the translation:

loves_em (X) = {Y : loves(X,Y)} Bill loves nobody? loves_em (bill) = {}

slide-5
SLIDE 5

Variadic Function II

theory of multisets or lists, etc. convenient but is it natural? enables us to represent functions not allowed by predicate logic need to define operations on functions in terms of underlying

multisets or lists...

can become complicated

Alternative

keep theory simple used proved lemmas

X Y Z = X Y Z X Y Z = Y X Z

For example:

Representing Negation

Multiplicative inverse inverse function is partial

zero has no multiplicative inverse

has_inverse (2, 0.5) has_inverse (0, ??) Make inverse function total by introducing special constant? Add: has_inverse (0, none) Problem:

0⋅none=1

Solution: use quantifiers not constants

∀X.. ¬ has_inverse (0, X) ¬∃X.. has_inverse (0, X)

Variadic Functions

Representing functions that can take a variable number of parameters (variable arity) Common examples:

2 3 4 3⋅ a⋅ s i n x 4 ≤ X ≤ 8

Variadic functions not allowed in first order logic Could represent + as a unary function on multisets (or bags)

23

  • 2, 3

23 4

  • 2, 3, 4

a⋅x

3b⋅x 2c⋅xd

  • a⋅x

3, b⋅x 2, c⋅x, d

can you think of an alternative representation for polynomials?

Multisets for variadic functions

Multisets

like sets (e.g. order unimportant) but allow repeated

elements

associativity and commutativity built-in

2, 3, 4 = 4, 3, 2

Non-commutative operators: append(''auto", append(''mated", ''reasoning")) might be represented using a list as append([''auto", ''mated", ''reasoning"])

slide-6
SLIDE 6

Importance of Semantics

Two important properties in AR:

Soundness: a reasoning method is sound if and only if it

deduces only the truth. Soundness is crucial: unsound reasoning is rarely useful

Completeness: a reasoning method is complete if and only if it

deduces the whole truth. Completeness is desirable, but often unattainable

These properties require a formal definition of truth and this

is what a semantics provides. Want good formalisms with proper semantics Semantics helps us ensure that we are actually representing what we had in mind

e.g. check through use of truth tables

Summary

We have considered axioms for equality, groups, sets, and

Peano arithmetic.

more than one axiomatization possible e.g. groups many other domains axiomatized: geometry, reals ... read Bundy Section 4.2 How to represent knowledge functions vs predicates use of multisets, lists ... dealing with negation importance of semantics

  • two important properties

soundness and Completeness

Bundy Section 4.3 See also Russell and Norvig (AI- a modern approach)

> chapters 6 and 7